So I’ve 2 characters, lets just call them Human and Cat. They both share the same Mecanim Animator Controller setup via Override Controllers.
Now while they both share the same setup, I’d like the Cat to NOT play the “Talk” state when it’s called. Is there a way to insert a NULL clip in the Cat’s Override Controller for the “Talk” state, or a way to detect the overridden clip’s name via script so that I can do some coding magic to ignore it when it’s the Cat?
I’ve also tried this script, but it returns “Talk” regardless of animation that overrides it.
I’ve spent hours Googling and have found nothing useful. I prefer not to add a boolean to all my characters to manually track this (I’ve got lots of characters and different states that needs ignoring). Legacy animation handles this nicely with a simple null check, but Mecanim is just not up for it.
hi, this code you wrote returns state, not the clip as far as I know.
I’m also new to using mecanim and having trouble to get the clip’s name, speed and setting them. So confusing and there is no scripting manual for mecanim to do these kind of things. If I can access state, I can’t access clip, vice versa. I hope someone points us to a good resource about this.
Yea I wish the docs were a bit more fleshed out. There doesn’t seem to be a way to access info of the playing clip as far as I’ve found. Wish they exposed more of Mecanim’s functions through script.
Thanks, Mecanim-Dev. I made a Talk clip for the Cat which starts and ends with frame 0 (essentially empty), but the Animator still plays it and the character just freezes for about a second.
On the other hand, a Talk clip that starts at frame 0 and ends with 1 worked a little better. It is still played, but only for 1 frame, so it’s baaaarely noticable except for the slight transition pop. I guess this is the best solution for now in the absence of a proper null/empty clip support.