How to add a restart function without going to my main menu.

Ok, I was playing around with what happens when my player is killed to see what I could do. I made it so my player is killed and it then ends the game and takes you to the main menu, Since starting the game I’ve had the idea that the camera would change to a fixed one in the scene which it does, I was wondering if there’s a way and if there is, how would I make it so a HUD menu comes up down the centre of the screen and lets the player quit or restart as well view their high score.

I like this idea because the menu would take up the middle of the screen but either side of it you’d still be able to see the enemies in the background moving around.

I’ll include of screen shot of my blueprint so you can see if there’s anything in there that I can use to make this happen. I understand I’ll have the make this HUD I don’t need to know how to do that. Just how I’d call it up on the screen when my player is killed.

AnswerHub won’t let me use the image importer thing, so I’ve just uploaded to Imgur, here’s the link: http://i.imgur.com/goLd1Do.png

Instead of OpenLevel function create your widget with quit and restart buttons. You can use Execute Console Command node with restartlevel command for your restart button and open level > MainMenu for the quit button.

Sorry about duplicate answers. AnswerHub is acting weird today.

Yeah it wouldn’t let me use the image thing.

I have a basic HUD made but I was looking for help on how to call it up at the end of the game. Right now, my character dies, the camera move to the right position then I want this HUD Menu to come up over that so they can restart/ quit with the enemies still moving and visible in the background.

You will create the HUD in whichever BP you are determining the player’s death. Lets say you are checking the player’s condition in GameState BP; When the player dies and the camera moves to desired location create your menu widget. Again, you’ll need to get rid of the open level node in order to let player see the level in the background and make their choice from the menu.

So I have a seperate Widget BluePrint called Restart_On_Death (Ignore my stupid naming conventions.) So where I had the open level in the last picture I’ve changed that to “Create Restart_On_Death_c Widget” and then changed the class on it to Restart_On_Death. That doesn’t work so obviously I’m doing something wrong, but I’ve never used widgets before and don’t know what I’m doing wrong. It’ll probably be obvious what I’ve done wrong to you though haha.

It must have something to do with the other parts of your BP then. For instance End Game section of the graph, it wont be true until the number of squad is less than 1, so that may be an issue. Also try bypassing Destroy Actor for testing purposes(just unplug the destroy actor node), instead disable input for the player pawn and see if it works.

You know like when you play the game and you can see what nodes are firing and where they go, when I don’t destroy the actor the number of squids which is just one (The player) Doesn’t go below one so it stops at the branch. But when I have it all plugged in it fires all the way to the end, it’s just not coming up, Is there maybe something in my Widget blueprint I need to tick/ Change?

Are you adding the widget to the viewport after creating it? Create Widget > drag the blue pin Add to Viewport.

Thank you this fixed it! Thanks for being so helpful!