Hi all,
This is a weird one.
I have a Damage FSM set on objects, and I have a Health FSM set on my Player. The Damage FSM on objects affects player health by adding -1 to the global health variable I have set up, which in turn affects the player health FSM by using int switches.
Everything works great until I apply the damage-causing FSM to an object in motion (using the Move Towards action).
When the object is in motion and the player hits it, it's fine until it gets to the last heart. Once it gets to the last heart and they collide, the global variable for health goes crazy and rapidly decreases from 1 to negative hundreds, thousands, etc. And then the FSM for Health on my Player remains stuck on 1 health. I don't understand what the hell is going on here. I will supply the screenshots. I am highlighting where in the Health FSM it gets stuck.
Remember, this all works perfectly when the object the player collides with is not moving.