You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NetworkRigidbody2D throws NullReferenceException on spawn when Rigidbody2D interpolation is Extrapolate #3924
I ran into a reproducible NullReferenceException when using NetworkRigidbody2D with a Rigidbody2D whose interpolation mode is set to Extrapolate.
This happens during multiplayer spawning on the non-owner/client side. Changing the same Rigidbody2D interpolation setting from Extrapolate to Interpolate makes the issue disappear immediately.
This makes it look like a package bug in NGO rather than a project-side null reference.
Versions
Netcode for GameObjects: 2.11.0
Unity Transport: 2.6.0
Multiplayer Services: 2.0.0
Reproduction Steps
Create a networked prefab with:
NetworkObject
NetworkTransform
Rigidbody2D
NetworkRigidbody2D
Set the prefab's Rigidbody2D.interpolation to Extrapolate.
Spawn the prefab in a multiplayer session (in my case as a player object).
Connect a client / let the non-owner instance spawn.
Expected Result
The object should spawn normally, and NGO should handle NetworkRigidbody2D without errors.
Actual Result
A NullReferenceException is thrown during spawn/initialization.
Stack Trace
NullReferenceException: Object reference not set to an instance of an object
Unity.Netcode.Components.NetworkRigidbodyBase.UpdateOwnershipAuthority () (at ./Library/PackageCache/com.unity.netcode.gameobjects@02e4aaa4170c/Runtime/Components/NetworkRigidBodyBase.cs:993)
Unity.Netcode.Components.NetworkTransform.InternalInitialization (System.Boolean isOwnershipChange) (at ./Library/PackageCache/com.unity.netcode.gameobjects@02e4aaa4170c/Runtime/Components/NetworkTransform.cs:3743)
Unity.Netcode.Components.NetworkTransform.Initialize () (at ./Library/PackageCache/com.unity.netcode.gameobjects@02e4aaa4170c/Runtime/Components/NetworkTransform.cs:3809)
Unity.Netcode.Components.NetworkTransform.OnNetworkSpawn () (at ./Library/PackageCache/com.unity.netcode.gameobjects@02e4aaa4170c/Runtime/Components/NetworkTransform.cs:3612)
Unity.Netcode.NetworkBehaviour.NetworkSpawn () (at ./Library/PackageCache/com.unity.netcode.gameobjects@02e4aaa4170c/Runtime/Core/NetworkBehaviour.cs:814)
Workaround
Changing Rigidbody2D.interpolation from Extrapolate to Interpolate fixes the problem.
Additional Notes
While investigating this locally, I noticed code in NetworkRigidBodyBase that appears to access the 3D rigidbody field during the extrapolation path:
Activity
EmandM commentedon Mar 30, 2026
Thanks for reporting this with all these details. I'll import this to be fixed!
NoelStephensUnity commentedon Jun 8, 2026
Hi @ercantomac,
We are getting the fix for this in place. It should be in the next update (that proceeds v2.12.0).
NoelStephensUnity commentedon Jun 22, 2026
#4012 resolves this issue and will be in the next update.
NoelStephensUnity commentedon Jun 22, 2026
The fix for this should be in v2.13.0.