[SOLVED] Why i can damage tree only once? (Health Extension)

Three have 20 hp

GDevelop_t7wPNgfjAv

Sound also plays only once

Replaying to yourself feels wrong
Anyway i know what is causing the problem i just idk why or is it a bug
In above screenshot PlayerActionV and H are objects i set to create when space is pressed
Which is spawning in front of player and you can see it’s animation as that white slash
Below i post screenshot of that event
I figured it out by setting player object on collision with tree play sound and display damage
And that works just fine

Replying to myself 2nd time :wink:
Problem was that i create object animation is played where last frame is 100% transparent so you don’t see that slash anymore but that does not mean object is removed from the scene
Solution
If object is created when pressing space i just needed to add delete object on space key release
Which would make that object constantly damage tree but it won’t be allowed cause of condition trigger once
And so it was spawning that PlayerActionH and V on tree and leaving it there even so animation indicated it was removed

Just FYI, if you have multiple objects of the same type hitting at the same time, and you have a trigger once function on, it won’t register multiple hits. So assuming your character hits that fast (like with no cooldown), that’ll be an issue in the long run, like if two of the strikes hit the tree within the same timeframe, it’ll bug out.

Are you sure about that?
Tree = 20 HP
Stone = 100 HP
No trigger once
GDevelop_2022-10-26_06_08_KwbsLsfPT5

With trigger once pressing space
GDevelop_2022-10-26_06_09_eKXmE2HIaU

With trigger once but using turbo on a controller (also enabled repeat for each instance to hit multiple targets)
GDevelop_2022-10-26_06_19_QqL5sNZWoB

Interesting. I’d have to look at it closer to see what’s going on haha.

I mean it does not bug out it works perfectly fine