Playing an external animation (not included in the animator stateMachine)

I’d like to play an animation that’s defined somewhere else than in the animator. For example, let’s say that there are hundreds of different items a character can use / pick up. I’d like to have AnimationClip defined in the item itself, so the animator does not contain a hundred different states for each one, also making the addition of new items easier and decentrailzed from the stateMachine. Is there any built-in solution?

I am still struggling with this, any ideas?

–

1 Answer

1

I’ve found a solution, it was hidden in an unexpected place. It’s called AnimationMixerPlayable

Am I understanding correctly, would this allow you to create a generic Animator for the example 100 items so long as the items had the same transitions? And then when the animator state is in (for example): Lying on ground, Holding, Airborne, opened from chest. So long as the items interact the same way in the scene, you can store the AnimationClip on the objects themselves. And taking it further you could have a base item, maybe a scriptable object with those AnimationClips as public variables?

–