How to Trigger a Transition
Last updated
Was this helpful?
Last updated
Was this helpful?
To trigger a transition in a State Machine, call the Trigger method of the State Machine and pass the ID of the transition you want to trigger.
Example: Imagine you have the following State Machine and want to trigger the transition with the ID Show Settings.
The following two examples will show how you could achieve this with an UI Button in the inspector or from inside a script.
This script will trigger the transition with name Show Settings on the State Machine set in the inspector when the āSā key is down.