I am new to GDevelop and was trying to make my character die when it fell off the platform. @andryimtv suggested, on a similar topic, to make a timer, so after 5 seconds of falling it would reset the game.
I tried it. It didn’t work. I would like some alternatives please
Thank you
Link to ToxicDesign’s post:Platform drop death
Link to andriymtv’s profile:Profile - andriymtv - GDevelop Forum
Edit: it may be my immaculate coding skills that are at fault
thank you very much! Nevermind, I have found a way, where i make an invisible boundary sprite, and if the player hits it, it resets the level! I will keep your way in mind though
There is a little logic issue here. You are resetting the timer before checking it’s value. Therefore, the condition will never be met, as the timer is set again to 0 just before you check it’s value. What you want to do is:
Reset the timer when the player leaves the ground, so player is falling and trigger once, else it’ll continue resetting until you are not falling anymore.
Then, you want to not have the event that checks the timer as a sub condition of the first, as you want the timer to always be checked, not only the moment it is resetted.
Finally, you want to check if the player is not falling, then stop the timer. Else, the timer wouldn’t stop after you got back on the ground.