1
PlayMaker Help / FSM Skips events or addition doesn't work
« on: February 24, 2016, 05:05:45 AM »
Hello,
I have an FSM where I get a value of a variable from another FSM on the same object. Add a negative value to it (to simulate reduction of HP) and then store it back to its FSM. The state has other actions (but they don't mess with this value).
I use the "Get FSM Int" (as the value is int) and I do the Add Int then do a "Set FSM Int" to set it back to the value I want.
The problem is that whenever I test this in play mode, nothing happens. All actions in that state fire without a problem but the actions relating to the manipulation of HP don't. I put in a Breakpoint on that specific state and went through frame by frame and found out that with the breakpoint this actually works but the math is wrong. The original value of the variable is 10 and I add to it -2 however I get a result of 6 even though I don't recall using that variable ANYWHERE else in the game.
Now I am not sure why it works with the breakpoint but not without it. I also am not sure of a way where I can track down all the FSMs that use the variable (I manually went through one by one and found nothing).
Here is a screenshot of the state:


Anyone can suggest a solution? Thank you very much in advance!
I have an FSM where I get a value of a variable from another FSM on the same object. Add a negative value to it (to simulate reduction of HP) and then store it back to its FSM. The state has other actions (but they don't mess with this value).
I use the "Get FSM Int" (as the value is int) and I do the Add Int then do a "Set FSM Int" to set it back to the value I want.
The problem is that whenever I test this in play mode, nothing happens. All actions in that state fire without a problem but the actions relating to the manipulation of HP don't. I put in a Breakpoint on that specific state and went through frame by frame and found out that with the breakpoint this actually works but the math is wrong. The original value of the variable is 10 and I add to it -2 however I get a result of 6 even though I don't recall using that variable ANYWHERE else in the game.
Now I am not sure why it works with the breakpoint but not without it. I also am not sure of a way where I can track down all the FSMs that use the variable (I manually went through one by one and found nothing).
Here is a screenshot of the state:


Anyone can suggest a solution? Thank you very much in advance!