# Is it necessary/advised to reference UI widgets in blueprints?

**URL:** <https://forums.unrealengine.com/t/is-it-necessary-advised-to-reference-ui-widgets-in-blueprints/728683>\
**Category:** UI\
**Tags:** unreal-engine, Widget, Blueprint, question, UMG, realityscan\
**Created:** [December 15, 2022, 4:31am UTC](https://forums.unrealengine.com/t/is-it-necessary-advised-to-reference-ui-widgets-in-blueprints/728683 "2022-12-15T04:31:50Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 15, 2022, 1:05pm UTC](https://forums.unrealengine.com/t/is-it-necessary-advised-to-reference-ui-widgets-in-blueprints/728683/3 "2022-12-15T13:05:37Z")

</div>

> [@Vigilant](#):
>
> […] wondering if this referencing process is strictly necessary, or if there’s some major benefit to doing it that I’m unaware of.

Unreferenced widgets that are not in a Container or Viewport will be destroyed and removed from memory - and this can be a good or a bad thing.

Imagine you’re doing floating damage numbers and showing it through widgets:

> [@Damage displayed](https://forums.unrealengine.com/t/damage-displayed/99716/3):
>
> Or use a widget: The widget is quite plain. You can add colours, crit sfx, alter font size, add outlines and so on. [widget.png] On Construct you position it in the viewport via an exposed variable and you set a target location for it to move towards to. The fading animating starts playing immediately. Event Tick will update its position. The animation changes text’s opacity from 1 to 0 over 1s and once it’s over, the widget gets removed from the viewport and garbage coll…

There’s no reason to reference those widgets, they can remove themselves once their jobs are complete and, eventually, get garbage collected.

But if the player has a complex inventory, you probably want to reference that particular widget to keep it alive and use the reference to interact with it.

---

_[View the full topic](https://forums.unrealengine.com/t/is-it-necessary-advised-to-reference-ui-widgets-in-blueprints/728683)._
