ProfilerCountersInfo.cs - NullReferenceException on NetworkManager.Start[...]()
See original GitHub issueI’m seeing a NullReferenceException when starting my NetworkManager with the following script. Replicable with any of the three start methods. Strangely everything still works and I can move a character on the host and see it move on the clients.
Versions:
Unity 2021.1.7f1
MLAPI 0.1.0
Script:
using MLAPI;
public class AutoStartNetworkClone : NetworkBehaviour
{
private NetworkManager netManager;
void Start()
{
netManager = GetComponentInParent<NetworkManager>();
netManager.StartClient();
}
}
Error:
NullReferenceException: Object reference not set to an instance of an object
MLAPI.Profiling.ProfilerCountersInfo.OnPerformanceTickData (MLAPI.Profiling.PerformanceTickData tickData) (at Library/PackageCache/com.unity.multiplayer.mlapi@0.1.0/Runtime/Profiling/ProfilerCountersInfo.cs:79)
MLAPI.NetworkManager.OnNetworkPreUpdate () (at Library/PackageCache/com.unity.multiplayer.mlapi@0.1.0/Runtime/Core/NetworkManager.cs:760)
MLAPI.NetworkManager.NetworkUpdate (MLAPI.NetworkUpdateStage updateStage) (at Library/PackageCache/com.unity.multiplayer.mlapi@0.1.0/Runtime/Core/NetworkManager.cs:635)
MLAPI.NetworkUpdateLoop.RunNetworkUpdateStage (MLAPI.NetworkUpdateStage updateStage) (at Library/PackageCache/com.unity.multiplayer.mlapi@0.1.0/Runtime/Core/NetworkUpdateLoop.cs:149)
MLAPI.NetworkUpdateLoop+NetworkPreUpdate+<>c.<CreateLoopSystem>b__0_0 () (at Library/PackageCache/com.unity.multiplayer.mlapi@0.1.0/Runtime/Core/NetworkUpdateLoop.cs:196)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
NullReferenceException on NetworkManager.Start[...]()
I'm seeing a NullReferenceException when starting my NetworkManager with the following script. Replicable with any of the three start ...
Read more >Netcode.Singleton Always Returns NullReferenceException
I tried programming a series of code using Netcode. However, trying to call NetworkManager.Singleton.StartHost(); , NetworkManager.
Read more >NullReferenceException when trying to start server or host ...
A small bug I encountered - when using the network manager HUD, if I start a client and then cancel and try to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It looks like for some reason it didn’t update your package cache. Try deleting the
Library/PackageCache/com.unity.multiplayer.mlapi
folder, then remove MLAPI from the manifest.json in the Packages folder and finally add it again using the link I posted above. That should work.@LukeStampfli amazing, that worked perfectly. Appreciate you taking the time to answer!