Widget for both PC and VR mode

I am working on a project that allows both PC and VR modes. I know how to create widget menus in both modes separately, but I want to know if there are better methods for creating menu/interaction widgets for both modes.

So I know that if I want to interact with widgets in VR mode, I need to spawn an actor to show the widget. However, this means that if I use PC mode to enter the game, I will also see that actor, while at the same time, I can also see an interface. (That means double interfaces.) I am now thinking that I should only spawn the widget actor only when the system detects a HMD, but I am not sure if this is a good solution or not, as maybe afterward, I will have to do the same thing for the other widgets.

if I want to interact with widgets in VR mode, I need to spawn an actor to show the widget.

No need for an extra actor, you can add a widget component dynamically to any actor (controlled pawn, perhaps) - only when needed:

image

Or create a 2d widget instead for the non-VR modes. What I cannot recommend is trying to switch between the components World ↔ Screen space dynamically. That’s just asking for trouble.

1 Like

Oh, I don’t know that it also works for VR mode as well, will try this later. Thank you!