Answer the question
In order to leave comments, you need to log in
Is there an easy way in unity to start the animation of an object once?
The problem is, I need to run the animation once (the user made a mistake with the input and I need to shake the object as if telling him about the error), but this animation can be run many times. In order for me to implement this, I had to create an animation, an animator, create a default empty state in the animator, create a trigger, and set the transition from this default state to animation by trigger and back, and set the trigger in the code. In principle, it’s not so difficult, but there are a lot of similar (not in appearance, but because they are one-time) animations and I don’t want to do this for each element. Is there something similar to the animation component that you just throw an animation on, and then run it from the code by name?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question