- Home /
How to trigger animations across state machines
Setup
I have one Animator state machine to control animations on my UI canvas.
I have another Animator state machine to control a clip on a gameObject.
The game runs for a certain amount of time and once the countdown timer reaches '00' a GameOver trigger gets sent to the UI animator and it plays GameOverClip.
Problem
The UI animation clip gets triggered properly when the timer runs down, but after it's done I need to trigger a game object animation.
I'm not sure how to do it correctly, I tried attaching a script to the GameOverClip state in the state machine and tried to send a trigger to the gameObject state machine but I wasn't able to wire up the reference correctly... (As in, I declared the external animator as public Animator in the script and tried to give the reference in the Inspector but it didn't take it.)
I'd rather not have to time the game over animation and then trigger the game object animation because that feels a bit fragile.
Any help would be appreciated.
Your answer
Follow this Question
Related Questions
State machine with multiple player inputs? 1 Answer
Fill in Sprites/Animations at runtime for Mecanim & State machines 0 Answers
"StateMachineBehaviour" Not working for sub sates ? 0 Answers
Animation plays only once 1 Answer
Multiple animators use the same controller / sate-machine or how to sync them? 2 Answers