- Home /
Trouble syncing player model animation over network
Hey all every time my player spawns in I get this error Exception in OnStartClient:Object reference not set to an instance of an object at Playersetup.OnStartClient () [0x0003c] Have no clue why, Here is the part its referring to public override void OnStartClient() { base.OnStartClient();
string _netID = GetComponent<NetworkIdentity>().netId.ToString();
Player _player = GetComponent<Player>();
GameManager1.RegisterPlayer(_netID, _player);
---> playerAnim.GetComponent<NetworkAnimator> ().SetParameterAutoSend(0, true);
}
Why does this happen??
Answer by lonelycamper · Jul 11, 2017 at 06:28 AM
Turns out just exiting unity going to bed and waking up the next morning did the trick
Answer by TheReEvolutions · Jul 10, 2017 at 02:46 PM
Have you tried rpc ? js example :
function Start() {
nView = GetComponent.<NetworkView>();
nView.RPC("PlayAnimationWalk", RPCMode.AllBuffered);
}
@RPC
function PlayAnimationWalk () {
playerAnimator.CrossFade("Walk",0.2,-1,0);
}
Isn't network view depreciated also I dont want to use the legacy version of animating
Thats not legacy , its animation controller.
That's despite the point. Network view is depreciated.... Doesn't matter anyways since some how just restarting the unity project fixed it