x

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"

Triggering a Menu Anchor

So I'm working on creating the main menu of a 2D platform game. I have a menu anchor on the main menu widget blueprint, and am able to get it to load a World widget blueprint. From the World widget I have it populating the world list in another widget. All that works perfectly OK.

Where I'm having an issue, is that when I select the desired world, I'm trying to get the menu anchor on the main menu to remove the world widget and load the level widget, which will populate all the levels for the selected world.

I'm able to get the world widget to close, but cannot get the level widget to appear. Is there something I'm missing to allow the menu anchor to open up again?

main menu event

world select widget - on click event

Product Version: UE 4.18
Tags:
more ▼

asked Feb 09 '18 at 04:12 AM in Blueprint Scripting

avatar image

Kevinpudlo
6 1 3

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

1 answer: sort voted first

I was able to finally get this to work! What I had to do was the following:

1. Create a new Widget, I called it Menu Anchor

  1. Add a Menu Anchor to the Widget view.

  2. Create a User Widget Variable, I called mine Target Menu.

  3. Create an OnMenuGetContent Function and build it as so.

alt text

2. Update the My Character Blueprint

  1. On your Event BeginPlay Add a Create User Widget, and a Menu Anchor Variable alt text

  2. Create a new Function, I called mine SetMenuAnchor
    1. In this section I do several things.

    2. First I check to see if the Menu Anchor widget is already active. If it is I move on to the next step, if not, I add it ot the viewport

    3. Next, using the Anchor Reference, I set what the Target Menu will be.

    4. Finally, I check to see if the Menu Anchor is open, if it is I close it and reopen it. If it isn't I just open

alt text

3. Call your Function.

The last step now is just to call the function. For each Widget you'd like to use it in, you simply set the Event Construct to cast to My Character. Then you simply set the On Button Click (or whatever Event you'd like to use) alt text

Hope this helps someone else, and if anyone has any other ideas I'd love to try them!

eventbeginplay.png (61.9 kB)
setmenuanchor.png (126.0 kB)
widgetevent.png (165.4 kB)
more ▼

answered Feb 10 '18 at 04:29 AM

avatar image

Kevinpudlo
6 1 3

(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