Widget:
Create Widget called MainMenuWidget
Add canvas, vertical and, 2 buttons, texts:
Add events “On Pressed” on 2 buttons
Create following graph for start and quit buttons:
BP Actor:
Create a BP class actor called MainMenuWidget
Add Widget Component, put as a root,
Choose Widget class with mainmenuwidget
Scaled down the canvas size if can’t see the menu in viewport:
Drag the BP in the scene
BP Pawn:
To interact the UI BP menu, create a BP Pawn, name as MainMenuPawn, open it
add the following components:
Change motion source to right in motioncontrollerright detail:
Add 2 Widget Interaction Components, name as WidgetInteractionLeft and Right, drag each under its motioncontroller root
set both trace channel as world dynamic, and either left or right interaction, set pointer index from 0 to 1 :
Go to Event graph, add new function, name as WidgetInteractioPointer
Create the graph with sequence 1,2 (for left, right controllers)
First, for Interaction left node:
assign static mesh below on add spline mesh component:
Continue:
Drag leftsplinemesh variable, R click and convert to validated Get
Connect them to branch and sequence as follow:
Duplicate the nodes applied to right, add new varialble on right spline mesh, and change widget interaction to right
Connect it to sequence 1
Back to Event graph, connect the function just made to event tick
Add Input action trigger left and right
Drag the pawn in the scene, set the auto possess payer and auto receive input as player 0