- Home /
How can I play an Animation once via script and then let the Animator component do his work ?
Hey I'm currently working on a game in witch I want my player to be animated with the animator, but sometimes I want to use the fonction AnimatorComponent.Play("AnimatioName"); but when I use this the animation play once and freeze at the last frame. So I'm stuck with the same Frame during the rest of the game. How can I enable the animator back so it can do his work after the animation plays ? Thanks for the Help :)
Answer by eskivor · Jul 22, 2017 at 12:49 AM
When an animation ends, by default it will stay at the last frame (unless your animation can loop on itself).
You has to add a transition to another animation at the end of the animation.
You can do it manually in the animator component, or you can add an event on the last frame of your animation that call a method in your script that play another animation.
thks but how can I make a transition to the animator Component ? because the reste of the animation are not done via scripting but only via the animator :)
actually I made an mistake , you were wright the transition works perfectly Thanks :) !!
Your answer
Follow this Question
Related Questions
Animator and Scripting problems. Help !! 1 Answer
How to create animations that can be edited with scripts in runtime? 1 Answer
Animator is not playing a Playable 2 Answers
Issue trying to animate multiple models with same controller and script 0 Answers
Is there a new retargetting system for the animation in 5.5? 1 Answer