Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Need help creating pre game and end game widgets

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!

Product Version: UE 4.9
more ▼

asked Sep 30 '15 at 03:12 PM in Blueprint Scripting

avatar image

3 3 4 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

To display widget on start , you need to create this widget on Event Beginplay of your Level Blueprint.

alt text

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.

wid.png (55.4 kB)
more ▼

answered Sep 30 '15 at 04:06 PM

avatar image

821 22 75 61

avatar image parasitic Sep 30 '15 at 04:23 PM

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:

1) Show the message widget, gameplay has not yet started in the background (i.e. player cannot move or shoot)

2) 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!

avatar image ambhar Sep 30 '15 at 04:38 PM

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.

alt text

lb.png (137.4 kB)
avatar image parasitic Sep 30 '15 at 05:28 PM

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.alt text

help_startui.jpg (78.9 kB)
avatar image ambhar Sep 30 '15 at 05:48 PM

Have you created a separate level for menu?

avatar image parasitic Sep 30 '15 at 06:13 PM

I've created an empty level for this blueprint, but encountered several issues in doing so.

1) 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).

2) 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?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question