I’m a newbie working off the FPS example, and could really use some help creating messages that show at the start and end of each game.
Basically I would like to display messages at the start like “Hit SPACE to begin”, and another at the end with “Press R to restart”.
I’ve already got the widgets done, but I have no idea how to script them right in Blueprints. I don’t know how to keep gameplay paused while the messages are shown, and I can’t seem to call key events within the widget blueprint either.
Would greatly appreciate any help here, thanks!
September 30, 2015, 4:06pm
To display widget on start , you need to create this widget on Event Beginplay of your Level Blueprint.
When you want to remove this widget , use “Remove From Parent” node.
Similarly you can create widget on end of game.
Key events are not available in Widget Blueprints, you can set those events in your Game Mode Blueprint or FPS Blueprint.
Thanks, but I apologise if I wasn’t too clear in my original question. Do pardon me as I’m really new to this.
Right now, my blueprint looks like your example there.
I already have my widget, and it shows up when I play the level.
Unfortunately, it stays there throughout, and the player can still move around and shoot as normal.
However, I would like to:
Show the message widget, gameplay has not yet started in the background (i.e. player cannot move or shoot)
Enter a key to remove the message widget, and player gets control back.
I’ve been searching for answers around here and through the tutorials but to no avail… Please help!
September 30, 2015, 4:38pm
You can create a separate level for your menu. On its Level blueprint Beginplay event “Create widget”. Add key event, and use “Remove from parent” in same level Blueprint. After that Open new level.
Sorry, it doesn’t seem to work for me. Hitting the key just restarts my game.
Here’s my Level Blueprint, which looks identical to your example. I had to link the widget reference Set to Add To Viewport otherwise I was getting a compile error.
September 30, 2015, 5:48pm
Have you created a separate level for menu?
I’ve created an empty level for this blueprint, but encountered several issues in doing so.
Unless I hit the key quick enough to load my map level, it quickly goes through to my end condition instead (basically quitting the game directly from the start screen).
This method also causes errors with Blueprint references in my Game Mode blueprint.
I just really want a simple message to appear at the start before the level begins, and another when it ends… Is this possible in UE4 at all without having to go through such workarounds?