When the game begins my animation starts playing once. But i only want it to start playing when i do animator.SetTrigger("playanimation);
So how do i fix this that it doesn’t play once at startup.
When the game begins my animation starts playing once. But i only want it to start playing when i do animator.SetTrigger("playanimation);
So how do i fix this that it doesn’t play once at startup.
What A_Lego said is good but if you don’t want to have to make a new blank animation or anything, you can just disable the animator by default, and then when you want the animation to trigger, instead of saying animator.SetTrigger("playanimation); you can just enable the animator. This works well if the GameObject only has one animation and you want to control when that plays.
Create a an Empty animation state within the Animator. If you right click within the Animator, it will give you the option to create an empty state. Set it as your default animation, then set a transition with a ‘playanimation’ trigger parameter on it towards whatever other animation state you want. Should do the trick