Need help with dpad and hp

im making this game and the dpad nor healthbar works like i want it to. The dpad makes it so that if i hold the buttons, the character only goes a certain amount of distance before stopping even if my finger is still on that direction. The healthbar makes it so that if it comes in contact with an enemy, it just restarts the level instead of only losing a small amount of health Flowlab Game Creator - Wizards' Dungeon

For the healthbar, make it go collision → level (restart current)
For the movement system, make it start a timer the first time you start your movement, and turn a switch off (movement) when it outputs.

1 Like

is it possible to have the character have a set amount of hp and make it so collision decreases it?

Yes, get the number -1 and + another number (health) and filter so if it’s equal to 0 it restarts the level.

1 Like

i tried that, but it just restarted the level as soon as collision was engaged.

Did you use a filter?

on the hp taken from collision?

No, on the current health.

im not very used to this program. i dont know how it should be used on a bar

Use a number to represent the health, add -1 then use the filter to see if it’s less than or equal to 0, and if it is, then restart the level.

i dont know why, but it failed. Could you please edit the game and show me what is wrong with the code?
the filter made it so that collision either did not deal damage or restarted the level immediately

try using a timer, have it repeat once, put it on 0.01 and put the timer between the -1 number and the health bar

Change the collision from “Any” to whatever you want it to lose health from. The number 5 can also be changed depending on how much health you want the player to have.

1 Like