# Getting variable from different instance of actor

**URL:** <https://forums.unrealengine.com/t/getting-variable-from-different-instance-of-actor/596668>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint, question\
**Created:** [July 4, 2022, 9:24am UTC](https://forums.unrealengine.com/t/getting-variable-from-different-instance-of-actor/596668 "2022-07-04T09:24:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 4, 2022, 9:48am UTC](https://forums.unrealengine.com/t/getting-variable-from-different-instance-of-actor/596668/2 "2022-07-04T09:48:57Z")

</div>

No need to spawn additional actors (expensive!) or `GetActorOfClass` (that’s currently the problem).

- each enemy has a widget component
- when they get hit, their own widget shows their own damage:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/a/eca3ef3c0e65a1f2f446430898548321a95c5479.png)

The above goes into the Enemy blueprint.

* * *

And once you’re ready for something more funky:

> [@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…

---

_[View the full topic](https://forums.unrealengine.com/t/getting-variable-from-different-instance-of-actor/596668)._
