# Custom text for 3D Widget - Get all Actors of Class

**URL:** <https://forums.unrealengine.com/t/custom-text-for-3d-widget-get-all-actors-of-class/402684>\
**Category:** UI\
**Tags:** get-all-actors-from-, unreal-engine, Widget, UE4, Blueprint, question\
**Created:** [August 23, 2017, 11:51pm UTC](https://forums.unrealengine.com/t/custom-text-for-3d-widget-get-all-actors-of-class/402684 "2017-08-23T23:51:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crossbones93](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crossbones93](https://forums.unrealengine.com/u/Crossbones93)\
**Post date:** [August 23, 2017, 11:51pm UTC](https://forums.unrealengine.com/t/custom-text-for-3d-widget-get-all-actors-of-class/402684/1 "2017-08-23T23:51:00Z")

</div>

Hi!

I’m trying to get specific actors from my level and then display a custom text on each of them (that has already been assigned on the specific actor instances in the level through a variable).

This is my widget, where I just have a plain text, which is changed through a variable that is located on the 3D Widget actor I am to use in the level (this is where I’m not sure what I’m doing wrong);

[https://puu.sh/xhXTz.png](https://puu.sh/xhXTz.png)

This is the 3D Widget in the level, that I try to display with a custom text (they are all the same actor, just copy pasted);

[https://puu.sh/xhXU0.jpg](https://puu.sh/xhXU0.jpg)

And lastly the Actor that has the 3D Widget with the variable “LevelText” that is set to editable. So that I can have a custom text on each instanced actor.

[https://puu.sh/xhYqR.jpg](https://puu.sh/xhYqR.jpg)

- [https://puu.sh/xhXTz.png](https://puu.sh/xhXTz.png)
- [https://puu.sh/xhXU0.jpg](https://puu.sh/xhXU0.jpg)
- [https://puu.sh/xhYqR.jpg](https://puu.sh/xhYqR.jpg)

My problem is with the “Get All Actors of Class” node, not sure how to do it for each instanced actor. Tried searching around, I do get examples of other things, bot haven’t found an example for my issue.

---

<div class="post-metadata">

**Author:** ![Crossbones93](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crossbones93](https://forums.unrealengine.com/u/Crossbones93)\
**Post date:** [November 9, 2018, 1:57pm UTC](https://forums.unrealengine.com/t/custom-text-for-3d-widget-get-all-actors-of-class/402684/2 "2018-11-09T13:57:53Z")

</div>

I eventually found a solution for this (as seen below).

My solution for this was to have two different blueprints, one widget blueprint and one actor blueprint.  
The widget blueprint is just a “Canvas Panel” and a “Text Box”, where the “Canvas Panel” has a width of 250 and a height of 100 (this is just up to how you want it).

[https://puu.sh/BYW7B.png](https://puu.sh/BYW7B.png)

The actor blueprint is the blueprint that will display the widget blueprint as a 3D Widget in the game world.  
So this is basically the only thing I did:

[https://puu.sh/BYW5N.png](https://puu.sh/BYW5N.png)

On “even begin play” I cast to “Widget\_LevelText” (which is my widget blueprint), with a reference of that widget blueprint connected to “Get user widget object” and then connected to “Object” on the cast node. I then get the text box from the widget blueprint, set a new text for it with “SetText (Text)” node, which has an editable text variable attached to it.

[https://puu.sh/BYW5d.png](https://puu.sh/BYW5d.png)

So now I can basically just copy paste the actor blueprint wherever I want in the game world, and rename each one to have their own specific text attached to it.

[https://puu.sh/BYW3o.png](https://puu.sh/BYW3o.png)

[https://puu.sh/BYW4u.png](https://puu.sh/BYW4u.png)

And that’s how I did it! 🙂  
If you know of a more cost-effective way to do it (not sure how cost-effective this is), then please do send me a message!

- [https://puu.sh/BYW7B.png](https://puu.sh/BYW7B.png)
- [https://puu.sh/BYW5N.png](https://puu.sh/BYW5N.png)
- [https://puu.sh/BYW5d.png](https://puu.sh/BYW5d.png)
- [https://puu.sh/BYW3o.png](https://puu.sh/BYW3o.png)
- [https://puu.sh/BYW4u.png](https://puu.sh/BYW4u.png)
