# Make size of world object resolution independent

**URL:** <https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [January 12, 2026, 7:28pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596 "2026-01-12T19:28:18Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [January 12, 2026, 7:28pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/1 "2026-01-12T19:28:18Z")

</div>

In screen space it is easy to **maintain** the pixel size of an element if we change the resolution.

I’m trying to do the same for an object/mesh in _world space_ by adjusting its scale.

But dividing by the values from ‘Get viewport size‘ doesn’t do anything, although it returns the correct value.

‘Get screen resolution‘ is also not helpful as it is not the resolution the game is currently running at.

So, how to maintain the pixel size of an object in world space?

---

<div class="post-metadata">

**Author:** ![Frenetic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frenetic/32/1142542_2.png) [@Frenetic](https://forums.unrealengine.com/u/Frenetic)\
**Post date:** [January 12, 2026, 7:33pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/2 "2026-01-12T19:33:52Z")

</div>

I don’t follow; send a mind-bug..

Trying to picture this but I cannot visualize. You want the on-screen coverage of a thing to always be the same size independent of the screen-res? eg: this thing always takes up x% of the screen, period?

---

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [January 12, 2026, 7:39pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/3 "2026-01-12T19:39:33Z")

</div>

Same size in pixels not percentage-wise.

E.g. an object with size x meters, y meters away from the camera has always a size of z pixels on the screen no matter the game resolution.

---

<div class="post-metadata">

**Author:** ![Frenetic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frenetic/32/1142542_2.png) [@Frenetic](https://forums.unrealengine.com/u/Frenetic)\
**Post date:** [January 12, 2026, 7:40pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/4 "2026-01-12T19:40:10Z")

</div>

> [@klen\_dhatu](#):
>
> Same size in pixels

oooooooooooooooooooooh hmmm, let me think, i don’t have an answer, but if can i will be back

---

<div class="post-metadata">

**Author:** ![ViceVersa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ViceVersa](https://forums.unrealengine.com/u/ViceVersa)\
**Post date:** [January 12, 2026, 9:35pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/5 "2026-01-12T21:35:20Z")

</div>

> [@klen\_dhatu](#):
>
> But dividing by the values from ‘Get viewport size‘ doesn’t do anything, although it returns the correct value.

how are you setting the scale? it sounds like thats the problem. i bleieve its called “Set Relative Scale 3D” and you need the mesh component to be the target

---

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [January 12, 2026, 10:54pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/6 "2026-01-12T22:54:21Z")

</div>

That’s exactly the way I’m doing it, triggered from a tick event.

The ‘get viewport size‘ node is marked as ‘cosmetic‘ and ‘client only’.

---

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [January 13, 2026, 3:56pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/7 "2026-01-13T15:56:58Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![Frenetic](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frenetic/32/1142542_2.png) [@Frenetic](https://forums.unrealengine.com/u/Frenetic)\
**Post date:** [January 13, 2026, 5:11pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/8 "2026-01-13T17:11:08Z")

</div>

does it need to be scaled-scaled in the game, or can it be done via WPO in a material?

viewproperties gives you some useful info:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/5/6953676a1be9bbacdc7278cf8abdb38b2d5d15a5.png)

---

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [January 13, 2026, 5:33pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/9 "2026-01-13T17:33:13Z")

</div>

I’m going to use it to generate a Procedural Mesh (a triangle strip) at runtime to keep it the same width (say 3 pixels).

If we could update WPO info when the resolution changes and get the view size in the actor blueprint.

---

<div class="post-metadata">

**Author:** ![Denny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Denny](https://forums.unrealengine.com/u/Denny)\
**Post date:** [January 13, 2026, 5:40pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/10 "2026-01-13T17:40:01Z")

</div>

You can use the basic projection relationship that is 1/z no? (Z being distance from view)

If you don’t want to use that calculation, or shaders like mentioned above, you can refer to how the editor code is used to display 2D sprites or 3D widgets. That should give you enough information to know how to go back/forth between world and view to determine the scaling. Two example functions you can look at:

class FDisplayClusterLightCardEditorViewportClient : public FEditorViewportClient  
FDisplayClusterLightCardEditorWidget::GetLengthScreenScalar  
FDisplayClusterLightCardEditorWidget::GetSizeScreenScalar

Most EditorViewportClient subclasses deal with the world-screen transformations to render custom things.

---

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [January 13, 2026, 5:50pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/11 "2026-01-13T17:50:19Z")

</div>

As you said, using 1/zdepth already got me to the point where everything keeps a size of say 3 pixels no matter where the camera is.

But, increasing the screen resolution makes it 5 pixels. I haven’t found a way to just divide by horizontal screensize for instance.

---

<div class="post-metadata">

**Author:** ![Denny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Denny](https://forums.unrealengine.com/u/Denny)\
**Post date:** [January 13, 2026, 5:55pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/12 "2026-01-13T17:55:32Z")

</div>

The example code in the functions above, for example this one, deals with DPI, screen percentages, resolution etc. Do you need Blueprint-code specifically?

FDisplayClusterLightCardEditorViewportClient::Draw

---

<div class="post-metadata">

**Author:** ![Denny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Denny](https://forums.unrealengine.com/u/Denny)\
**Post date:** [January 13, 2026, 5:57pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/13 "2026-01-13T17:57:35Z")

</div>

I recall this old thread that was dealing with similar issues. Maybe you can find the BP nodes you need from there.

> [@Offset in Convert World Location to Screen Location](https://forums.unrealengine.com/t/offset-in-convert-world-location-to-screen-location/301216/18):
>
> Sorry to resurrect but I was facing this same issue in Slate/C++ on UE 5.5 and translating your BP logic to C++ actually worked in my case! FVector2D ViewportSize; ViewportClient-\>GetViewportSize(ViewportSize); float ViewportScale = GetDefault\<UUserInterfaceSettings\>()-\>GetDPIScaleBasedOnSize(FIntPoint(FMath::TruncToInt32(ViewportSize.X), FMath::TruncToInt32(ViewportSize.Y))); ScreenPosition /= ViewportScale; The ScreenPosition variable from above was the result from UGameplayStatics::…

---

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [January 13, 2026, 6:04pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/14 "2026-01-13T18:04:23Z")

</div>

GetViewportScale is always 1 for me, GetViewportSize has no effect (I can only print those values).

---

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [January 13, 2026, 6:21pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/15 "2026-01-13T18:21:07Z")

</div>

@Denny @Frenetic @ViceVersa Thanks guys. It’s not the end of the world as I’m half a decade away from shipping anyway.

Moreover, having a slider for the user to be able to adjust the width depending on his eye sight and preferences is prob. not a bad idea.

---

<div class="post-metadata">

**Author:** ![Denny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Denny](https://forums.unrealengine.com/u/Denny)\
**Post date:** [January 13, 2026, 6:30pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/16 "2026-01-13T18:30:41Z")

</div>

This is what you want right? The trick is that you need to determine what dimension of your viewport is what your object should relate to. You need to pick vertical, horizontal, or diagonal size. See attached video for result.

p.s. the logic was put together just to get it working, it’s not perfect, optimized or mathematically great d.s.

[2026-01-13 19-28-36.mkv](https://forums.unrealengine.com/uploads/short-url/xT89T2CstgaVu3qmZiNfOAeyc8F.mkv) (5.1 MB)

 ![Screenshot 2026-01-13 192816](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/0/3/603f19ed739c075d017f212b5aa0d7d69ef7335a.png)

---

<div class="post-metadata">

**Author:** ![klen\_dhatu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@klen\_dhatu](https://forums.unrealengine.com/u/klen_dhatu)\
**Post date:** [January 13, 2026, 6:59pm UTC](https://forums.unrealengine.com/t/make-size-of-world-object-resolution-independent/2691596/17 "2026-01-13T18:59:59Z")

</div>

@Danny Using the GetViewportSize from the PlayerController and not the node with the same name from WidgetLayoutLibrary indeed solves the problem, Jesus. Thanks a lot! 👍
