How to add 2D overlay HUD in VR?

How to add 2D overlay HUD in VR not as 3D, for example, if I got the key a text will display on screen says “got the key” then disappear

Hi saiffa

Its not good practice to render 2D objects in VR. Basically, the scene gets rendered twice (one for each eye) so drawing directly to the viewport(s) would be quite disorientating for the user.

It is better to place a 3D plane in front of the camera with a material that renders over the top of the world.

Edit: It is more immersive for the user to have a curved plane around the camera to draw 2D UI.

Hope this helps.

Alex

1 Like

Thanks Alex! is there any advance tutorial for this :)?

Hi Saiffa.

A quick search lead me to this video which shows how to set the material on 3D ui to render on top of everything: Unreal Engine Tutorial - VR UMG Widget UI Infront of Everything Depth Render - YouTube

As for everything else. you can use just a standard primitive plane with the 3D widget component as a child, or you will need to create the curved plane yourself. One potential hack would be to place the camera inside of a primitive cylinder and just make the materials double-sided. Make sure on the widget component you set the “Geometry Mode” to a cylinder (for the curved result).

The most fiddly part is to match the scale of the 3D objects to the scale of the 2D UI. After some trial and error, you should get the results you want.

Hope this helps.

Alex .

Great Thank Alex :slight_smile:

No problem. I hope you get your issue sorted. Please mark this as the correct answer so others can find this solution in the future.

Good luck

Alex!

i searched 1 day about 2d widget in vr lol , and now i undrestand these searchs are useless at result