Currently my player object has an
Animator with an
AnimatorController that manages things like walking, jumping and running. The thing is that I want to play certain simple animations on demand, like opening a door or pressing a button. I don’t think creating a state for each of those is the best solution because they happen in very specific moments and don’t need to have a complex system with a state, transitions and parameters in the controller.
Basically those animations could be triggered by some
InstantAnimator component with a method as simple as a
PlayAnimationClip(AnimationClip clip) that overlap the current animator state and simply play the given animation clip.
I tried to implement something like this using the
AnimatorOverrideController but it only replaces animations that already exist in the controller, there is no way to play new ones. I also read a few things about the
Animation component, but i’ts legacy so I think that there might be some other solution that isn’t legacy.
The question then is: Is there a way to do this? Or I should actually create a state in the animator controller for each of those small animation clips?