how to prevent Function is being called multiple times.



die func works 2 times i want to take 100 point when i kill the enemy but it gives me 200 point. thx for helps.

You figure out why it’s being called twice and stop it from happening in the first place. I don’t expect anyone will be able to tell you why it’s happening based on those 2 screenshots alone.

1 Like

you have an IsDead bool, put that before your DieFunc and it can only die once.

assuming the logic is in the right place, ie on the enemy not the character

1 Like

The set timer by function name has a function called DieGoomba in it. Does that function also add to score?

Either way, I’d suggest changing die into an event and using a DoOnce or logic Gate node in it to control execution. Event graph tends to be a better place for stuff that gets delayed or delegated to a timer.

1 Like

thank you

thank u

it does not adding score before but i deleted all points and only add points from here. now it adding 100 points. thank you. btw this casting is true? access from enemy to my character. object is get player character.

Use the engines Apply Damage events. Pass your controller as the instigator.

From controller → Get Player State → Add Points.

Damage functions should start with a conditional check.

Is Health and Damage > 0 → process damage.

1 Like