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"

Best way to script menu screens?

General Widget Blueprint / Scripting question here...

Let's assume I have a Main Menu widget with 2 buttons on:

  • PLAY (launches me directly into my game level using "Open Level" node)

  • LEADERBOARD (opens up a leaderboard screen...would have a "back" button on it to return to Main Menu)

My questions are:

  1. If I was to click on "Leaderboard" would I be best to "Remove from Parent" my created Main Menu widget BP and then Create / Add to viewport my "Leaderboard" widget BP? Or is there a better, more preferred way to engineer that? Know that I'd want ALL of this "menu flow" to take place within a "Main Menu" level I'd set up for the purpose of ONLY interacting with menu screens (NOT actually playing any of the main game.)

  2. Let's assume I did the above but now I want to click on the "BACK" button within my "Leaderboard" screen. Is it best to "Remove from Parent" my created Leaderboard widget BP and RECREATE / Add to Viewport my Main Menu widget BP?

I basically want to know if I should be Removing from Parent the widget BP I no longer way to show and Creating / Adding to Viewport the widget BP I do want to show. I just feel like there may be a more elegant way to flow from one menu screen to another?

Product Version: UE 4.18
more ▼

asked Apr 11 '18 at 06:18 PM in Blueprint Scripting

avatar image

121 20 32 41

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

3 answers: sort voted first

Hey. I'm quite new to Unreal so don't completely trust this, but what i've been doing so far is simply toggling the visibility of parts in the Mainmenu HUD on and off once a certain button is pressed using the "set visibility" node.

more ▼

answered Apr 11 '18 at 06:50 PM

avatar image

40 3 7

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

Im also quite new but the way i do my hud is with animations and i just have everything off screen and comes onto screen via button click

more ▼

answered Apr 11 '18 at 07:03 PM

avatar image

91 1 7 2

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

Depends what exactly you want. I couldn't quite grasp your particular functionality but I will say this... it sounds like you'd be best served with an "empty" level that contains the main menu widget. This widget gets created by the level blueprint. When you hit play it loads your first game level. Now the confusing part. This leader board, do you want that available all the time in any level? Then yes, set visibility to open and close it. If not, if this is something that only opens from the main menu I would overlay in on the main menu and when you click leader board hide the main menu, then when you hit back hide the leader board and reveal the main menu again.

more ▼

answered Apr 11 '18 at 07:04 PM

avatar image

Nebula Games Inc
5.4k 28 9 15

avatar image VagrantProfile Apr 11 '18 at 07:55 PM

Yeah, that's essentially what I've done so far.....I've got an "empty" level where I'm creating my main menu widget within (through the level blueprint.) I DO want this leaderboard to be available ONLY when the player is within the main menu (and then, once accessed / displayed, having the player return BACK to the main menu.) I haven't yet explored going the "Overlay" route to displaying the Leaderboard from off of my "Main Menu" widget (for both screens....I want to STAY in my empty "Main Menu" level.)

Not sure if one approach or the other is more performant? Or if it even matters much for this small of a menu system?

I feel like there should be some sort of master "Widget BP" hierarchy asset that should exist that'll automatically handle going from one widget BP to another when devs want to create layered menus!!!

avatar image Nebula Games Inc Apr 11 '18 at 08:17 PM

I just make 2 menus and hide one. Lay one right over the other in the editor and toggle visibility accordingly.

(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