Hi again everyone!
Today I was trying to develop some scripted component with FSM inside. Everything went great if not for some strange bug causing FSM to stop, and eventually I found that two of my events are handled concurrently in the script.
I was expecting that events should be handled sequently, queued in the object, but seems like that’s not the case. Here’s what happening:
Event1 is sent to the script from another entity in FixedUpdate
While Event1 is being handled, a timer method fires from DelayedExecute (initiated from the same script) and throws Event2 to self for FSM input. But it actually seems to be handled concurrently to Event1, producing most unexpected results in FSM.
I am not familiar with internal engine cycle, so does that mean that Update and FixedUpdate run in separate threads?
And how do i solve the concurrency issue in my case?