- Home /
Animator.Play()?
I am making a 2d mutiplayer game and to sync the animations I thought I would send the name hash of the current state and play the state on the other end. The only problems is the animations don't play properly, they briefly play for a very short time (In game it looks like a flicker). Does Animator.Play() only play the animation once? even if it is on loop? If so is there any way I can loop the animation?
Answer by mediumal · Aug 18, 2014 at 11:04 PM
Perhaps the conditions for the state's exit transitions are triggering immediately. You may need to set the appropriate animator parameters before playing the state to prevent the exit condition from occurring.
In my multiplayer game I don't use Animator.Play(). Instead I sync all the animator controller parameters using a custom script that is observed by the animating object's NetworkView. That works well for me.
I will mess around with it, and try your method as well. The only reason I was using this method was that I thought it would be less information being sent over the network
As an update I am seeing issues where just syncing animation parameters can sometimes lead to remote nodes getting into a bad state. I am going to be investigating using Animator.Play() ins$$anonymous$$d of or in addition to setting animation parameters.
Your answer
Follow this Question
Related Questions
Is default hash of Animator state names fixed for a given controller? 1 Answer
Problem with Animator.Play() 0 Answers
Animation not be found 1 Answer
Animator problem start animation 1 Answer
Mecanim when call setTrigger, plays next clip twice 2 Answers