I am trying to set my animation.layer over the network. I have
animation[Animations.crouchMeleeAttack.name].layer = 1;
which works perfectly for me. Setting that allows my layer 1 to override my layer 0 animations and I can see the attack as it should happen. Where I don’t see results is over the network. I have tried
photonView.RPC("SetAnimLayer", PhotonTargets.AllBuffered, Animations.crouchMeleeAttack.name);
[RPC]
public void SetAnimLayer(string anim){
animation[anim].layer = 1;
}
But no luck.
I get:
NullReferenceException: Object reference not set to an instance of an object
CharacterAnimation.configureAnimations () (at Assets/FPS Kit 2.0 C#/_CustomAssets/Scripts/FPScontroller/CharacterAnimation.cs:316)
If there is a way to set animation layers in the inspector, or a way to set it with an RPC call, that’s what I’m looking for.