Hi, there. I was trying to do the space shooter game from the Gdevelop wki, but I got stuck in the “Damaging player” part. I don´t know why is not working, the health text is supposed to change if the player gets hit by a meteor, a bullet or the enemies, but it is not when I play it.
probaly it is just a detail, but I can´t find it.
Can someone tell me what is wrong, please?
Your text modify action has no condition, so it should execute.
What does the text object display?
Confirm that Player has Health behavior installed (and not deactivated somewhere in the events).
Does Player die, even though the text doesn’t change?
The original text says “health: 100”, the behavior is installed in the player with 0 Damage cooldown, 100 health and 0 in maximum health.
Wait, do you mean the health behavior is installed? Because you’re not using the behavior actions in any of your events.
wait, really? where should I put it? I followed the steps on the wiki and I got stuck, what did I mis?
Nope, ignore me. I’m blind. I forgot the icons got changed with the recent extension updates.
Biggest recommendations: you’re missing 'trigger once" on your collision events that do damage, so they’re constantly trying to set the health every frame, instead of the first time it occurs.
Also You could probably skip the “isDamaged” variable entirely and just damage the player with the collision.
I… kind of understand what you mean, but I don´t know how to add it on the game.
I will give it a try. Thank you.