Hi,
I think I need some more schooling on structuring my FSMs. I'm encountering some situations that are confusing me, and I think they may be to do with sending global events, when they are received, the fastest way to get things to happen, the order they happen in, etc.
As per my last solved thread (which is only semi solved...), I'm storing a collision contact point and then measuring the angle from the player to that point. I've also setup a debug FSM that pauses every time I hit the ground so I can examine a debug line pointing to the collision point position.
What I've found is that times where I should be recording an angle to the ground of 90deg (parallel), the update speed seems to be too slow (despite the game running quite fast), so what happens is that I've seen the debug ray pointing back (where the player touched the ground maybe 1-2 frames ago?), which is enough to tell the game that the angle is actually more like 130 degrees, which messes things up...
To initiate these actions I'm using a global TOUCHDOWN event, so I'm assuming all FSMS with this global transition do everything in the same frame? Or is it not that simple? How can I ensure that the angle/point I'm measuring is on the same frame that I touch the ground?
Another thing that has had me baffled with this same issue, is that I'm trying to use a simple Get Angle to Target, but for some reason I can't seem to get it to store a variable unless there is no transition out of its state. So I would like to store the angle just on the one touchdown frame, then use that variable, however if I ever try and do anything with it or FINISH/transition, it just stays at zero.
This leads me to generally think that I'm doing something wrong, or maybe just dont understand transitions that well at all! Would love any help you can offer.
Regards,
Jay