Using HUD in Virtual Reality with Unreal Engine 4 2


Virtual Reality (VR) game development is much different from regular game development. For example, something like a basic head-up display (HUD) to show some stats would work fine in a regular game, but not in VR. In fact, standard HUD would cause rendering issues because it adds itself to the Viewport.

So how can you use HUD in VR then? In this post, I will go over a way for you to bring your HUD into 3D space for Unreal Engine 4 (UE4).

In this post, I am assuming you have some familiarity with UE4 already. Here are some terminologies:

  • HUD ↔ User Interface, User Widget
  • 3D HUD ↔ WidgetComponent in a Blueprint
  • 3D space ↔ World

Note: the left-hand side is more generic, while the right-hand side is UE4

Creating a standard HUD

Create your HUD while keeping in mind two things. First is you need to account for the visibility of your HUD in VR. Second is you need to change the size of the HUD to be a custom size. The width and height are completely up to you; just make sure it has good visibility in VR.

For tips about how things are best viewed in VR, you can visit my post about Virtual Reality development with Unreal Engine 4. Specifically, you will want to go over the Best Practices for Virtual Reality section.

Here is an example User Widget with custom size settings:

sample standard HUD

Standard HUD with custom size settings

Creating a 3D HUD

If you use your standard HUD and preview it in VR, you will notice the HUD will not be visible or cause rendering issues. For you to use your standard HUD, you must bring it into 3D space (world).

An easy way to do this is to create an empty Blueprint Actor class. In your Blueprint Actor, add a new component call “Widget“. Select the widget component and in the Details tab navigate to User Interface. Set the Widget class to your standard HUD class. Then change the Drawing Size to match your HUD. The X corresponds to the width and Y corresponds to the height.

Here is an example Blueprint Actor with a widget component that is all set up:

sample bp 3D HUD

Blueprint Actor containing 3D HUD setup

Adding 3D HUD into World

There are two ways to add your 3D HUD into the world. One way is to simply drag the HUD into the world editor and then place it where you want. The only disadvantage to doing this is that the HUD is only visible at that specific location in the world.

editor view of 3D HUD

3D HUD in world editor

Another way is to spawn the HUD dynamically from some sort of user input. For example, you can have the left trigger of the VR controller spawn the HUD near the player. This way the player can always bring up the HUD when they need to.

Here is an example of dynamically spawning a HUD near the player in Blueprint:

dynamic HUD spawn

Dynamically spawning HUD to the left of user with left trigger

3D widget HUD in VR

3D HUD spawn to left of user in VR


I hope you found this post helpful. If you found this post helpful, share it with others so they can benefit from this post too.

Was there anything I left out, that you think I should talk about? Feel free to leave a comment.

Also, to stay in touch, you can follow me on twitter.


About Steven To

Steven To is a software developer that specializes in mobile development with a background in computer engineering. Beyond his passion for software development, he also has an interest in Virtual Reality, Augmented Reality, Artificial Intelligence, Personal Development, and Personal Finance. If he is not writing software, then he is out learning something new.

2 thoughts on “Using HUD in Virtual Reality with Unreal Engine 4

Comments are closed.