hi, i've decided to create a game making Construct 2. i'm having problems with the health system for the player though, i want it so if it hits a wall then it takes off health, and if it hits 3 times then you die and restart the level.i have a Global Variable for health set to 8 and when the player collides with the walls it subtracts 2 from the healthi also have a compare variable when the health is = to 0 it restarts the layout

but when ever the player hits the wall they die almost instantly and it either continues playing the level with 0 health or it freezes. i've tried looking for health tutorials but can't seem to find the problem

It sounds like what the problem is you have the game subtract health "when overlapping the wall?" as opposed to "on collision with the wall?" The game rapidly constinues to subtract health in the blink of an eye cause the player is still "overlapping" the wall. But if it tests for "on collision", it should only take a hit once even if the player is standing by the wall. The player will then have to break contact with the wall and "collide" again to trigger more health loss. Also, you don't need a compare variable to determine if health is equal to zero. Just compare your global "health" variable directly to zero, not to another variable that is equal to zero cause that's redundant.

i have the player set to on collision with wall, and they cannot go through the wall they can only touch it

i also made a lose screen, to test if it would work - the player hits the walls and after 4 hits it loaded the lose screen no problem - i added a button on that screen so the player could restart the level but when you click retry the level flashs for a second and it goes back to the load screen. i'm not sure what the problem with the level is