- Home /
Animator - How to change the motion (Anim Clip) on a STATE through scripting?
Imagine a game similar to the Sims. There is 1 character and several objects in an apartment. Everytime the character interacts with an object it triggers a unique animation.
Each object stores the AnimationClip for the actor to interact with.
This means I can have a very clean Animator State machine where I only call the InteractWithObject state and change the animation depending on the object.
My problem is that I can't figure out how to access or change a State motion...
Also I know how to use AnimatorOverrideController(), but what that does is update the selected CLIP with a new CLIP, independently from what State is using what clip. This means that if I'm using the same clip in some other state, it will also change that clip...
Is there a way to do this? If not, is there a way to tackle this without having to create tons of states, one for each object?
Did you ever figure this out @castor? I would like to try and do the same.