Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Great engine and runs well in the latest March 2025 Gamemaker 2.3 update. I have a question about obj_char Health. I want the game to reset to the main menu when the character has 0 health. Currently, obj_char doesn't die, so I'm not sure where to edit the code?

I can’t really tell what you’re doing there, but you’ll probably want to create a new gamestate within the obj_cam object. The gamestates function to determine every possible situation, and will continuously make sure that there is a player object if it isn’t a menu or transitioning into another screen.
Maybe define a gamestate in obj_cam, destroy the obj_char instance, create a new instance for the destruction animation at the obj_char coordinates, and then move to the title screen room. Health and other game variables are tied to the persistent obj_cam object, so they will not be reset unless you specifically do so. Again, not super sure how you’re exactly doing this or what changes you’ve made, but just some suggestions. Hope the help!

Thanks for your kind reply. Helpful information about creating a new gamestate. The obj_cam object is where I need to edit the code. Take care.