Fix Unity 6.5 SceneHandle and Object ID compile errors - #1051
Merged
FirstGearGames merged 1 commit intoAug 17, 2026
Merged
FirstGearGames merged 1 commit into
FirstGearGames merged 1 commit into
Conversation
Adds a Unity compatibility helper for SceneHandle and UnityEngine.Object runtime IDs, replacing obsolete SceneHandle int conversions and Object.GetInstanceID usage that fail compilation in Unity 6.5. Also removes reliance on GetInstanceID sign checks when cleaning up runtime observer condition instances. Validated in Unity 6000.5.0f1 with zero compile errors, host/client connection, reconnect, global scene load/unload, and late client global scene synchronization.
|
Will this be merged at some point? |
|
Having the same error, thanks for the PR but when will this be merged? |
Contributor
Author
I do not have permissions to merge. You can clone the branch and use it, or pull from my fork |
|
@FirstGearGames Can we get a review on this please. |
Owner
|
Merged into Pro -- had to make some minor changes but will be in the next release. |
FirstGearGames
pushed a commit
that referenced
this pull request
Sep 2, 2026
- Fixed ZigZagDecode improperly decoding values in IL2CPP with specific backing CPP libraries. - Fixed Scene object expecting prefab ID (#1032). - Fixed eliminated or significantly reduced wobble in local reconcile resimulations on server-authoritative objects. - Fixed NetworkAnimator delay/desync on host owned object, observed by clients (#1062). - Fixed NetworkCollider/2D tick comparison error (#1041). - Fixed prefab objects generator cannot include folders with spaces in the path (#1045). - Fixed large writers pooling incorrectly, causing them to not be re-used (#1054). - Fixed LiteNetLib wrong data length after BasePacketLayer modification (#1064). - Fixed NetworkTrigger2D by uncommenting entire file. - Fixed nested NetworkObjects not spawning recursively when spawned via OnStartServer of their parent. - Fixed SyncType values being reset to default before OnStopServer as clientHost (#1036). - Fixed disconnecting clients not being cleared on Transport shutdown (#1044). - Fixed Quaternion ScaleToFloat helper math, cause of marginal rotational errors (#1067). - Fixed loading scenes by path not loading the scene for clients under certain conditions (#1060). - Obsoleted SceneLookupData.Name in favor of SceneLookupData.FullName. - Added NetworkBehaviour.ToString null safety (#1046). - Added Unity 6.5 scene handle change support (#1052 / #1051 merge). - Added Unity 6.5 GetEntityId/GetInstanceId support. - Added NetworkCollider2D use PhysicsScene2D.OverlapCollider as a fallback (#1042). - Added NetworkCollider/2D.RemoveEnteredCollider. - Added NetworkCollider/2D InvokeStayOnEnter. - Added NetworkAnimator channel option - under Beta menu, Animator Channel (#1039).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes Unity 6.5 compilation errors caused by obsolete Unity APIs that are now treated as compile-breaking errors.
Unity 6.5 reports direct
Object.GetInstanceID()usage as obsolete and recommendsGetEntityId(), and deprecates implicitSceneHandleconversions to/fromintin favor ofGetRawData()andFromRawData().Changes
UnityCompatibilityhelper methods for Unity-version-safe access to:UnityEngine.Objectruntime IDsSceneHandlevaluesSceneHandleconstruction from raw dataSceneHandleimplicitintconversions with raw handle access.GetInstanceID() < 0for observer condition cleanup and replaced it with explicit runtime-instance tracking.Validation
Tested in Unity
6000.5.0f1.Validation performed: