As far as making it “work” with VR, all you need to do is create an actor class, add a widget component, and then make the widget component the root. After that, it’s just positioning that actor into the world. This part is easy. I think what people really want is for the UMG widget to be attached to the player, in 3d space. This part… I wouldn’t include in this project to be honest, since this is highly dependent on the person’s game. However, it’s done by adding a BP actor (the one created above) to the component list.
The other “VR features” are, in order of importance:
- Controller support (UMG should support this out of the box, why it only supports mouse and keyboard out of the box is… something Epic needs to look into. However, there are a number of “BP hacks” you can do to implement controller support)
- Look-at support (Look-at support just involves a line trace from the camera to the UMG button / area. When the line trace is successful, then that button becomes active, allowing the player to click on it)
Here is how “VR menus” should work, in my mind… and this is what I am most comfortable with, using a screenshot that was provided in the examples:
- User activates the menu (“Special Right”, aka: Start button)
- Menu is divided into the 3 vertical areas (I forget what they’re actually called atm), and the 1 horizontal area at the bottom. We’ll call the verticals as VB1, VB2, VB3, and the horizontal as HB1 (Left to right, top to bottom)
- When the user looks at (Camera trace) to VB1, then that section becomes “active”.
- At this point, the user can use the up/down to cycle through the items.
- If the camera trace hits on the “SDsdflj sd s Hsdf”'s (2nd item in VB1) drop down menu, then that drop down itself becomes active.
- However, if the user does not activate the drop down (instead of activating it using the… “face button bottom” (aka: the A button), the player can still select other objects. An example of this behavior would be in HB1. If the player looks at Save Settings, then it will become active. However, if the player (still looking at save settings) presses the right button or right axis, then the Cancel and Return button becomes active.
It takes a bit of logic for this type of behavior, but in the end, it is much more of a natural interface to work with than using just one or the other. Of course, there are exceptions, and this behavior should be selectable (Look-At, Controller, Hybrid).
Something else I would suggest, not specifically VR related, but the ability to populate a menu with items from a data set. Specifically, when the user “unlocks” a level, then that level becomes selectable in the game for the user to transport to. This could be a horizontal/vertical layout box filled with buttons (button text and level names coming from the data set) or drop down menu items coming from the data set.