Hi!
I’m looking for a way to send the state of animation to the server from Animator without parameters by HashCode and number of layer. This is in order to automate and make the operation with the server more compact. I used “Animator.Play” but it doesn’t work.
How i can to do it?
What exactly doesn’t work?
Animation with the specified HashCode doesn’t start.
For clarity, the code:
Send to the server.
if (AnimationHashCode0 != __animator.GetCurrentAnimatorStateInfo(0).fullPathHash)
{
Server.Instance.sendAnimation(Values.Instance.character.Id, __animator.GetCurrentAnimatorStateInfo(0).fullPathHash, 0);
AnimationHashCode0 = __animator.GetCurrentAnimatorStateInfo(0).fullPathHash;
}
if (AnimationHashCode1 != __animator.GetCurrentAnimatorStateInfo(1).fullPathHash)
{
Server.Instance.sendAnimation(Values.Instance.character.Id, __animator.GetCurrentAnimatorStateInfo(1).fullPathHash, 1);
AnimationHashCode1 = __animator.GetCurrentAnimatorStateInfo(1).fullPathHash;
}
Receive from the server:
_animator.Play(hash, layer);