Hi.
Depending on what you are doing in that frame, its possible not everything is done in that frame.
If a object does not need to setup things and only needs to do 'Get Owner' and place in a global, you can also use 'Game Object Is Null' to check.
Even in C# coding you need this type of checking.
Hi!
Thanks for the reply, I now have a state that checks "is null" in these scenarios and it is working fine. However...
... the main issue still kinda remains, how do I ensure that some actions/states are run in a particular ordet. For instance: I have a simple state that, on activation, checks if a gameobject is within a triggerbox. This is handled with a
On trigger Stay. If the object is NOT in the trigger box, it should proceed to the next state in the fsm.
I have fixed this with a
Next frame event that is run directly after the
On trigger stay. This works in like 50% of the time. I guess the issue is that
On trigger Stay is not always managed to run on the exat first frame (due to computeing and calculations?) and the Next frame event runs before and the FSM proceeds to the wrong state.
So: How do I ensure that the the ordering is correct? How is stuff like this managed in C#? I know that there is a "Late Update" that could be used for stuff like this, but not all actions have this option and the issue would be there as well, what happens if a lot of stuff happens in Late Update, what would be executed first?
Right now the best way I found is the use a
Wait for like 0.3 sec, but this feels very unreliable and clunky way of programming.