NullReference NetworkTransform line 3067

Hi all,

Unsure what caused this to happen but suddenly when playing the networked VR app im making, im getting the error:

NullReferenceException: Object reference not set to an instance of an object
Unity.Netcode.Components.NetworkTransform.UpdateInterpolation () (at ./Library/PackageCache/com.unity.netcode.gameobjects@1.8.1/Components/NetworkTransform.cs:3067)

Line 3067 is this: var serverTime = m_CachedNetworkManager.ServerTime; which im guessing that the reference to the networkmanager is null. Its for interpolation which I would prefer to keep on.

The network transforms that are causing this are on my network player on child objects the layout is:

Network Player (has Network object and network transform)
----Head (Has network transform)
----Left Controller (Has network transform)
----Right Controller (Has network transform)
----Left Hand (Has network transform)
----Right Hand (Has network transform)
----PC

And all of the network transforms on this network player is having this error apart from the parent. Unsure what it causing this to happen any suggestions for fixes would be great,

Thank you for any replies.

Edit: it only seems to happen in the editor and not in any of the builds

2nd Edit: I cant reproduce this issue anymore, unsure as to why as I haven’t changed anything, if this happens again ill comment on this post

3rd Edit: Its back again and this time on builds aswell

Solution:
Make sure the gameobject is not being disabled on start, wish the error was caught rather than giving me a random line in the interpolation code but for anyone who has this issue check that you’re not doing that. If you have multiple different types of players in my case for different platforms I would suggest not using the playerprefab in networkmanager rather make your own playermanager with different player prefabs

Hey, also getting this error but for seeming different reasons since I don’t have any game objects disabled on start in my scene. Hopefully we can get some visibility on this from the unity team

Very quick update: It seems like a server rpc I was calling was failing to serialize it’s parameters (logging an exception in the console which I missed). That server rpc was responsible for updating the NetworkTransform of a game object. After fixing the parameter serialization issue I’m not getting the issue anymore, so I guess somehow the 2 issues are related. Hopefully that helps anyone else or the unity team debug this issue