Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
There are three options:
1. Create an event in the desired animation frame and hook the method there. A clumsy and inconvenient method, but as an option, if the animation is one and will not change. In the latest versions of the unit, they can even be added from the code , but I still would not advise running methods through lines.
2. Pull Animator.GetCurrentAnimatorStateInfo inside OnAnimatorMove . Not a super reliable method at low fps, short transitions can be skipped, but otherwise quite normal and suitable for synchronizing something with animation time.
3. Use StateMachineBehaviour . The most versatile and reliable way, if desired, classes can be initialized using
Animator.GetBehavior . Requires manual hanging of scripts on graph nodes, but this can be easily automated if desired.
Don't forget about the Animation component as well . It is poorly supported in recent versions, but at least the current animation is trivially determined.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question