Trigger to restart statemachine
Is there an easy way to restart the statemachine (from a trigger)? Ideally without having to create a manual default state where I have to key everything. If there are best practices around this, please share examples. TY 🙏
There's no way to automatically return to the initial state without creating a new timeline that defines the initial state. Depending on which runtime you're using, there might be a way to stop and completely restart the state machine from scratch.
Hey!
So the short answer is yes you can restart your state machine on a trigger, but you'll need to define that default state (which yes, could include a large number of keys). Here's a video with a bit more on the topic.
I appreciate the video, but I wholeheartedly disagree with this approach. It works well for simple demo files but gets out of hand quickly with multiple timelines and layers. Essentially, what I am looking for is a return to Entry
. Wherever Entry
leads to is the default state. It's the equivalent what you can do in the runtime with reset()
.
You can do it in iOS with reset()
and was hoping for an equivalent trigger to easily restart a statemachine without keying every single property.