thefuntastic / Unity3d-Finite-State-Machine

An intuitive Unity3d finite state machine (FSM). Designed with an emphasis on usability, without sacrificing utility.
MIT License
1.6k stars 234 forks source link

Setting game object to inactive during transition can cause errors #3

Closed thefuntastic closed 3 years ago

thefuntastic commented 9 years ago

In particular when the state change is initiated by a late event method such as OnBecameInvisible this is presumably because deactivating the game object is beating the Enter Couroutine in some way.

thefuntastic commented 9 years ago

In general, deactivating the game object at any point during a transition can cause errors. This goes with Unity convention as deactivating an object will disable coroutines.

Also need to make sure that the previous transition doesn't stall Safe transitions when the game object is reativated

thefuntastic commented 3 years ago

Deciding this is a won't fix as behaviour follows what would happen with disabling monobehaviours mid coroutine. In short, don't do it!