Whenever i cause a state transition in the animator, for example by setting a boolean, I get a NullReferenceException on my Server.
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Networking.NetworkAnimator.FixedUpdate () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkAnimator.cs:115)
Since I don’t have access to the code I was hoping someone might have an idea what’s causing that.
Thanks in advance!
This would be a stack trace from the Editor side (the server). The Client doesn’t seem to throw any errors.
To add further information:
I’m basically using the Ethan ThirdPersonController Animator (with heavy changes on the script part).
Using Commands i send the input to the server and on the server every character runs around just fine.
The running animation is also synchronized to the clients - however the position isn’t.
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Networking.NetworkAnimator.FixedUpdate () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkAnimator.cs:115)
The behavior I’m seeing visually is that my object’s transform information is being distributed but the animation states are not.
My version of Unity is 5.1.2f1
I’ve attached an image of the inspector for the prefab in question.
Is this a NetworkAnimator bug? When I look at the reflected code I saw this in NetworkAnimator.FixedUpdate():
if (base.hasAuthority || (ClientScene.readyConnection != null))
{
ClientScene.readyConnection.Send(40, msg);
}
else if (base.isServer && !base.localPlayerAuthority)
{
NetworkServer.SendToReady(base.gameObject, 40, msg);
}
But I noticed in editor that the server does believe it to be the authority over the NetworkBehaviour (see attached screencap).
So it feels like it is incorrectly hitting the ClientScene.readyConnection.Send() conditional when it needs to be using NetworkServer. My guess is that it should be (base.hasAuthority && ClientScene.readyConnection != null) I was running into this issue when I was running in stand-alone server mode.