# Widget component 'screen space' occlusion.

**URL:** <https://forums.unrealengine.com/t/widget-component-screen-space-occlusion/23449>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [March 9, 2015, 12:12am UTC](https://forums.unrealengine.com/t/widget-component-screen-space-occlusion/23449 "2015-03-09T00:12:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![C\_Albeluhn](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/c_albeluhn/32/729295_2.png) [@C\_Albeluhn](https://forums.unrealengine.com/u/C_Albeluhn)\
**Post date:** [March 9, 2015, 12:12am UTC](https://forums.unrealengine.com/t/widget-component-screen-space-occlusion/23449/1 "2015-03-09T00:12:18Z")

</div>

Hello everyone.

I was looking into a name display system for planets in my game. I was looking into ‘widget components’, and under the ‘UI’, there is a ‘space’ setting where you can choose either World or Screen. The effect I am wanting is sort of a mix of the two. I want the text to lock to the screen and always face the player (as is done using the ‘space’ setting), however I want the text to be occluded when a planet is drawn in front of it (as is done using the ‘world’ setting). Is there a way to occlude a widget that is drawn behind another object while its UI space setting is set to ‘screen’?

![6819c5db50d9c76b1c09de28d6094e305638f9d1.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)  
Here you can see the settings I am using for my widget component.

![f4090e03fc82bea8d7abb4b0ccda0390fbb23da0.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)  
And here you can see the names of Venus and Mercury being rendered over the planet Earth.

Is there a setting within the widget component that I’m not aware of, or is this something not supported by the current widget setup and I’d have to find a work around to the problem?

Thanks in advance everyone!

---

<div class="post-metadata">

**Author:** ![starfighterdude](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/starfighterdude/32/464988_2.png) [@starfighterdude](https://forums.unrealengine.com/u/starfighterdude)\
**Post date:** [March 16, 2016, 2:36am UTC](https://forums.unrealengine.com/t/widget-component-screen-space-occlusion/23449/2 "2016-03-16T02:36:14Z")

</div>

I know this is an old post, but did you ever figure out how to achieve this?

---

<div class="post-metadata">

**Author:** ![FHC\_Disco](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FHC\_Disco](https://forums.unrealengine.com/u/FHC_Disco)\
**Post date:** [October 18, 2016, 11:43pm UTC](https://forums.unrealengine.com/t/widget-component-screen-space-occlusion/23449/3 "2016-10-18T23:43:20Z")

</div>

I was hopping to find that answer as well ☹

---

<div class="post-metadata">

**Author:** ![JaredTherriault](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jaredtherriault/32/1194499_2.png) [@JaredTherriault](https://forums.unrealengine.com/u/JaredTherriault)\
**Post date:** [October 19, 2016, 2:03pm UTC](https://forums.unrealengine.com/t/widget-component-screen-space-occlusion/23449/4 "2016-10-19T14:03:14Z")

</div>

You could do a line trace from the camera to the widget position and if it’s broken don’t render it.

---

<div class="post-metadata">

**Author:** ![pblpbl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pblpbl](https://forums.unrealengine.com/u/pblpbl)\
**Post date:** [August 31, 2022, 8:08pm UTC](https://forums.unrealengine.com/t/widget-component-screen-space-occlusion/23449/5 "2022-08-31T20:08:41Z")

</div>

That solution wouldn’t be desirable if you wanted part of the widget to still show up when an object’s widget was slightly occluded.

Does anyone know how to implement this?

---

<div class="post-metadata">

**Author:** ![JaredTherriault](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jaredtherriault/32/1194499_2.png) [@JaredTherriault](https://forums.unrealengine.com/u/JaredTherriault)\
**Post date:** [September 1, 2022, 4:17pm UTC](https://forums.unrealengine.com/t/widget-component-screen-space-occlusion/23449/6 "2022-09-01T16:17:18Z")

</div>

Line trace to each corner of the widget and only hide it when all four line traces are broken. This is an old camera trick.

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [September 1, 2022, 10:52pm UTC](https://forums.unrealengine.com/t/widget-component-screen-space-occlusion/23449/7 "2022-09-01T22:52:21Z")

</div>

When set to World guess you could always brute force the widgets scale relative to camera if you dont mind it clipping through actors:  
 ![WidgetBruteForce](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/8/4c8814798dd21adfda2d85d1316d440d9470e71f.gif)  
 ![WidgetOccludedWorld](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/0/6d040b3f23138ea1c9fcfe890cbf4207a0907a92.gif)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/2/052c9fad9dc0a65533ede05e01c80f633eb04aa9.png)

or when using Screen just turn it off when a specific component (with cast shadows set to false) has been occluded:  
 ![WidgetOccluded](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/b/cebf9987567de90c3f0db2068daaabaf6694bb71.gif)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/6/206c0d8a1fe03ec1ec7ed4e5ff6d8bae2ea039d0.png)
