Null reference or Unity crashing when requesting state authority in Shared Mode

Options

Hello!

We had been trying to request state authority of an object but we end up having a null reference or the client crashes depending on what we are trying to do.

To give information about this, we have a GameObject in the scene with NetworkObject and our own component that inherits from NetworkBehaviour.

If we try to request state authority by doing:

Object.RequestStateAuthority();

or GetComponent<NetworkObject>().RequestStateAuthority();

or somePublicVarAssignedThroughInspector.RequestStateAuthority();

We end up having a null reference at some point.

After that, we saw that we already had a NetworkObject that we were requesting the state but we were doing that after a few seconds so we added a delay and tried again the three upper options in this new GameObject. Now it not only doesn't work but it also crashes the app.

Is there some sort of guide we can follow to know what is happening and what we are needing for it to work?

Thanks in advance!

Answers

  • monoflauta
    Options

    We found the reason of Unity crashing. Apparently it crashes because the NetworkObject has Network Mecanim Animator component in four different child game objects. Not sure if with only one it would work but for now we removed all those components and it is working now.

    Is there a way to solve this issue and be able to use Network Mecanim Animator?