I want to have a main menu in the same level as the character, instead of having it in a whole new level. Having the player input disable, only moving in the menu. When “start game” is pressed on, a matinee will play then I will take control of my character and play the level.
For first part you need to do something like in the image 1 in the desired level so on EventBeginPlay it will add the MainMenu to viewport using the Set Input Mode UIOnly wich target is your players controller and the Widget to focus the same that you Create using Create Widget then you just add to viewport. For the second part lets assume you have A Play Button add something like image 2 to its click event.
I’m sorry for the delay, but I haven’t received an E-mail until now. I don’t understand the second picture. Which blueprint are you putting those nodes in? This is how I have my widget blueprint setup, for my menu.
Hi, nodes in the second picture are within Main_Menu widget Eventgraph.
The key in there, regardless of how you manage to Create/Remove widgets, are the “Set Input Mode UI Only” and “Set Input Mode Game Only” so player while in UIOnly will only able to use menu and when in Game Only able to play normally.
Ok, i think you are not handling the keypress correctly,
As you need to trap the keypress within a widget it works different, you need to override the OnKeyDown event, to do that select the On Key Down option in the Override drop down next to Functions as in this capture:
You will get a new function set your nodes as this:
Note: You will need to handle your rutine/logic in there I only set the if you press G the main menu will close and give control to layer over level. You can remove the Print String after debug it is just to make you notice that the Key was detected when pressed.
Make sure they’re both visible, have the eye open on the left panel showing all the variables. so when you’re on the menu, you press continue or new game, then the matinee would play. I haven’t tested this yet, but I hope this puts you in the right direction