<Solved>Why is enemy not damaged?

I’m working on my prototype for an rpg. When the player clicks on their enemy (currently just a “dummy,” aka, a red box with an x in the center), the current party-member is supposed to pathfind to the enemy, and a variable called “difficulty” is supposed to be randomized, and then, if it is below the party-member’s “attribute” attribute, then the dummy will lose health. It works, but it’s instant, rather than as soon as the party-member has reached their destination.

But when I prompted that this would only happen when the party-member had reached their destination, the dummy stopped losing Health. Difficulty is incapable of being above 100 and one of my party-members has an attribute of 100.



![Screenshot 2025-03-11 205135|690x397]


The 2 left monitors are (top-bottom) the number of turns that have passed, out of the number of party-members currently in the scene, and the number of moments/series of turns, that have passed. The 2 right monitors are the dummy’s health and the number that has been rolled. Since one of the party-members has an attribute of 100, the dummy should be missing 25 hp, but the dummy, as you can see, is not, which is the problem.

The pathfinding actions are called once, when the left mouse button is released.

Checking the party has reached its destination will get checked once, and then that’s it, because the mouse release condition occurs once, when the mouse button is released.

You’ll need to move the “party reached its destination” event (add the condition “The variable 'selected' of party is true” to it) so it is in line with the “left button released” event. This will ensure it gets checked all the time, not just when the LMB is released.

I think I get what you’re saying. So, basically, move the player to the dummy, but the destination reached condition and subsequent actions shouldn’t be under the mouse release?

But, since the player is going to be reaching many different destinations, many of which will have nothing to do with this, do you agree that a state-machine is probably a good course of action?

I.e., if party has reached the destination, if party is in collision with dummy, if party variable “state” = true, then subtract attribute - difficulty?

Okay, yeah, it works.