I have a character using Mecanim with all its main animations run by a controller script, but sometimes I want it to run unique animations while interacting with specific objects and don’t really want those stored in the animation controller. It would allow me to keep the state machine manageable while also allowing me to add objects more easily in the future.
I’m nearly certain that this can’t be done with Mecanim in its current form, but I’m hoping I’m wrong. Below is an example of what I’d like to do. This would run in a method in the object after the player Gameobject is passed in as user:
Animator userAnim = user.GetComponent<Animator>();
userAnim.GetState("Interaction").SetClip(this.action); //I know this doesn't exist
userAnim.Play("Interaction", 0);
If the legacy system is the only way to do this, is it possible to run legacy animations on a character that is also using Mecanim or do I need to convert everything to legacy to pull this off?