i have a health variable attached to my player, and when An enemy touches me It takes away from that number. Once the number reaches zero I have it set to disable character control input, play a sound, wait about 2 seconds and then reopen the level.
This is done with Blueprints.
Although when the input is disabled and i’m waiting for the level to reload while the sound is playing the rest of the enemies and everything are still moving and doing as they’ve been told.
Is there a way to freeze the game as weal as stop the ambiance background music in the back I’ve created until the level resets??
There is a Set Game Paused node that can be used to pause/un-pause the game when your character is dead. You could also use a Set Global Time Dilation node to slow the game speed way down (doesn’t completely stop it but makes it VERY slow and doesn’t show the Paused text like Set Game Paused does).
These are just some ways you could do it, alternatively you could tell all the actors in your level to perform an action upon player death (like go to idle or something).
Ok…this will give me some options. Yhank ys sir. I apreciate it.
I honestly can’t get either one of them to do anything. Neither of those nodes stop the game. I’ve got them in my MYCHARACTER BP. Everything else works. the input is disabled and then after 2 seconds it opens the level…but when I set either of those nodes in there it does nothing…any idea?
How are you calling those nodes. You might need to do it in the level blueprint instead of the character blueprint (if your character is dead/destroyed) it’s not going to call those events.
I’m not really killing the character…It’s just restarting the level. It’s a quick you took too much damage and you try again. . . I’ll try an event dispatcher.