How to invoke UI on PC screen(VR Spectator) and not on VR HMD?

Hi,
I am working on a VR project, my current problem is how to show a ‘Settings’ UI on PC screen alone while someone else is using VR HMD at the same time. A second person should be able to change settings in the PC screen, while that UI is not rendered for the VR HMD user. So far I tried Spectator following this livestream, is there a way to invoke UI in VR Spectator alone?

Currently I can show the UI when HMD is not connected:

1 Like

Hi, have you find a solution for this? I need to do almost the same thing

I have a project in VR coming and I’m wondering the same thing.
Maybe this plugin can help? I’ve used it before. But I’m not sure it would work with VR

I suggest using RetainerBox and SpecatorScreenTexture.

Follow the steps:

  1. Wrap your widget tree with two RetainerBoxes one by one:
    image

The root RetainerBox makes your widget invisible, and the nested one writes the widget to Material that we use as a texture for SpectatorScreen.

  1. Create a material for the root retainer box:

image

  1. Create a material for the second retainer box:

image

  1. Create a render target, assign it as a spectator texture, and refresh it every tick with the widget material:

  1. Then setup the spectator screen:

image

As a result, you have a widget invisible to VR, but you can see it on your monitor screen and interact with it.

My Products

1 Like

Hey mate, I’m just giving this a try. This may be a really stupid question, but i dont seem to be able to divide these two?

Disable this:

That’s great mate, thanks for the quick response. Everything seems to be working, but its just displaying very small on screen, do you know why that may be?

The widget is displayed exactly as it is.

Sorry, I don’t follow what you mean?

I mean, your widget is small.

Hey man, I really appreciate the help on this, but no matter how much I scale the widget canvas, it still displays at this size. is there a scaling option somewhere in the blueprint chain or something?

Show your widget tree, please.

Sure, here:

image

My example assets:
Spectatorwidget.zip (776.2 KB)

Extract into ‘Content’.

Your file is working perfectly, thanks mate!!!

I have a problem with this approach. The button click is not aligned with the button. This happened in your files as well. Did anyone encounter this issue and figure out a workaround for this ?

1 Like

Yeah same problem here… Anyone manage to fix the misalignment?

Hey there, been able to implement this solution successfully, truly grateful for this info.
Two things come to mind :

  • I’m trying to set up a system to show and hide the widget. As this is a render texture, Should I suppose that the best course of action is simply to change the Spectator screen mode? Or is there another way to clear the render target?
  • What was this tested on? Getting good results on the index, but somebody tried on a Quest 3, without success.

Thanks!

I have this same issue too. After digging a little bit, it looks like since the widget is added to the pawn viewport, it gets the hmd resolution (4128x2272 in my case with quest 3) and not the spectator resolution (1920x1080). I’ve been playing with different resolutions and resizings but i can not make the visual part of the ui match the actual place where it happens for the moues… Somone knows more about this?

To anyone still with problems with the mouse alignment i’ve found the solution in this other post: (Mouse Interaction during stereoscopic rendering - #8 by RC-1290)

Just follow instructions in comment from nov 2023 and it works.

Still not perfect as i have to test it better but at least you can create a interactive widget showing only in the spectator screen.