# UWidgetComponent HUD does not keep consistent screen size when zooming / changing distance – how to fix?

**URL:** <https://forums.unrealengine.com/t/uwidgetcomponent-hud-does-not-keep-consistent-screen-size-when-zooming-changing-distance-how-to-fix/2714815>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [April 12, 2026, 1:55pm UTC](https://forums.unrealengine.com/t/uwidgetcomponent-hud-does-not-keep-consistent-screen-size-when-zooming-changing-distance-how-to-fix/2714815 "2026-04-12T13:55:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![InkSmith](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@InkSmith](https://forums.unrealengine.com/u/InkSmith)\
**Post date:** [April 12, 2026, 1:55pm UTC](https://forums.unrealengine.com/t/uwidgetcomponent-hud-does-not-keep-consistent-screen-size-when-zooming-changing-distance-how-to-fix/2714815/1 "2026-04-12T13:55:30Z")

</div>

Hi everyone,

I’m working on an RTS-style project in UE5 where each regiment actor has a floating HUD using a `UWidgetComponent`.

Here is how I set it up:

```cpp
HUDWidget = CreateDefaultSubobject<UWidgetComponent>(TEXT("HUDWidget"));
HUDWidget->SetupAttachment(RootComponent);
HUDWidget->SetWidgetSpace(EWidgetSpace::Screen); // or World depending on tests
HUDWidget->SetRelativeLocation(FVector(0.f, 0.f, 250.f));
HUDWidget->SetDrawSize(FVector2D(200.f, 60.f));
HUDWidget->SetDrawAtDesiredSize(true);

```

The widget is a `UUserWidget` (`URegimentHUD`) containing progress bars and a text label.

* * *

### Problem

I want the HUD to:

- always appear the **same size on screen**

- regardless of:

Right now, the widget’s perceived size changes depending on how far the camera is or how much I zoom in/out.

* * *

### Question

What is the correct way to make a `UWidgetComponent` behave like a **true screen-space HUD element** , while still being attached to a world actor?

I want it to stay anchored above the unit but maintain a constant screen size like UI/HUD elements.

* * *

### What I already tried

- `SetWidgetSpace(EWidgetSpace::Screen)`

- `SetDrawAtDesiredSize(true)`

- adjusting `SetDrawSize(...)`

But I still can’t get consistent screen-size behavior.

* * *

### Context

This is for an RTS system with many units, each showing health and morale bars above their formation.

---

<div class="post-metadata">

**Author:** ![ShadowBr0kerz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shadowbr0kerz/32/1201558_2.png) [@ShadowBr0kerz](https://forums.unrealengine.com/u/ShadowBr0kerz)\
**Post date:** [October 23, 2026, 8:12pm UTC](https://forums.unrealengine.com/t/uwidgetcomponent-hud-does-not-keep-consistent-screen-size-when-zooming-changing-distance-how-to-fix/2714815/2 "2026-10-23T20:12:13Z")

</div>

set the widget component to screen space, that is the whole trick: HUDWidget-\>SetWidgetSpace(EWidgetSpace::Screen). screen space draws the widget at Draw Size in viewport pixels, so distance and zoom dont change how big it looks. world space projects it in 3D, which is why it grows and shrinks with the camera.  
turn Draw At Desired Size off in this case, it only makes sense for world space widgets. if you ever need a world space one at a fixed screen size, you have to scale it by distance yourself.
