Hello everyone,
I want make a kind of control panel for VR game (I use steamVR and HTC Vive). It’s just widget with buttons, and the one who is sitting by PC can press them and run some scripts, but player shouldn’y see that control panel.
So I think it’s can be implemented like widget but I can’t find out how make it invisible in VR glasses.
GameMode in “begin play” event just enables HMD, creates widget and add it to viewport, but it works in opposite way: widget is shown in vr glasses but invisible on PC.
How can I do it?
Beforehand thanks for your answers.
You could draw your widget as Spectator Screen Texture in this case.
How to:
-
Create a TextureRenderTarget2D to draw your widget:
-
Wrap your widget tree with two RetainerBoxes.
The First RetainerBox will hide your widget for HMD, and the second one will draw the widget to the render target.
- Create two materials for retainers:
Visibility
Draw Widget
-
Draw Material:
-
Hide widget for HMD:
Debug:
- Next, draw your render target on the spectator screen:
I hope it’ll be helpful to you.