gd-YAFSM icon indicating copy to clipboard operation
gd-YAFSM copied to clipboard

(feature request) any state

Open tomankirilov opened this issue 3 years ago • 5 comments

I often find myself needing to have a state that can be reached by all other states with a single condition. Making transition arrows from each state creates a big mess and everything looks quite confusing. When using unity's state machine I have noticed they have a "any state" state. Implementing soemthing like this should make state machines cleaner.

tomankirilov avatar Jan 09 '22 16:01 tomankirilov

Can you point me to the documentation of unity's "any state" state?

imjp94 avatar Jan 10 '22 03:01 imjp94

Thats the best I can find: **Any State** Any State is a special state which is always present. It exists for the situation where you want to go to a specific state regardless of which state you are currently in. This is a shorthand way of adding the same outward transition to all states in your machine. Note that the special meaning of Any State implies that it cannot be the end point of a transition (ie, jumping to “any state” cannot be used as a way to pick a random state to enter next). https://docs.unity3d.com/Manual/class-State.html

tomankirilov avatar Jan 10 '22 14:01 tomankirilov

Cool, I do have some experience with unity's state machine but I never knew the existence of "any state". And I think the implementation should be as easy as adding a special state - named "Any State"(literally, just like "Entry" or "Exit")

imjp94 avatar Jan 10 '22 14:01 imjp94

Exactly! It is not a big feature but helps you keep the spaghetti away.

tomankirilov avatar Jan 10 '22 14:01 tomankirilov