leron9999 Posted August 19, 2013 Share Posted August 19, 2013 Hi guys. I've been playing around with states recently, and I was wondering: what happens to an OnUpdate() event that has yet to be called when switching to a new state? For example: State sampleA Event OnBeginState() RegisterForSingleUpdate(300) EndEvent Event OnUpdate() ;Do something EndEvent Event OnHit(...) GoToState("sampleB") EndEvent EndState State sampleB ;Do something EndState What happens to the dangling register if the event OnUpdate() if OnHit is called first (meaning it is never called)? Does it get unloaded/unregistered automatically since it's a single update? Link to comment Share on other sites More sharing options...
CraftySentinel Posted August 20, 2013 Share Posted August 20, 2013 Hi guys. I've been playing around with states recently, and I was wondering: what happens to an OnUpdate() event that has yet to be called when switching to a new state? For example: State sampleA Event OnBeginState() RegisterForSingleUpdate(300) EndEvent Event OnUpdate() ;Do something EndEvent Event OnHit(...) GoToState("sampleB") EndEvent EndState State sampleB ;Do something EndState What happens to the dangling register if the event OnUpdate() if OnHit is called first (meaning it is never called)? Does it get unloaded/unregistered automatically since it's a single update? The OnUpdate() will still be called from the new state, so it will not unregister automatically, and I am not sure using a OnEndState() with UnregisterForUpdate() actually works for Single Updates... There's a talk page on the Wikia which talks about this issue: Talk:State Reference Link to comment Share on other sites More sharing options...
leron9999 Posted August 20, 2013 Author Share Posted August 20, 2013 Ah, I see. Thanks a lot! Link to comment Share on other sites More sharing options...
Recommended Posts