# Why do I need to cast to one actor after getting it from a class but not the other?

**URL:** <https://forums.unrealengine.com/t/why-do-i-need-to-cast-to-one-actor-after-getting-it-from-a-class-but-not-the-other/449231>\
**Category:** Blueprint\
**Tags:** unreal-engine, score, UE4, Blueprint, question\
**Created:** [May 19, 2019, 5:03pm UTC](https://forums.unrealengine.com/t/why-do-i-need-to-cast-to-one-actor-after-getting-it-from-a-class-but-not-the-other/449231 "2019-05-19T17:03:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![StreamLined](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StreamLined](https://forums.unrealengine.com/u/StreamLined)\
**Post date:** [May 19, 2019, 5:03pm UTC](https://forums.unrealengine.com/t/why-do-i-need-to-cast-to-one-actor-after-getting-it-from-a-class-but-not-the-other/449231/1 "2019-05-19T17:03:48Z")

</div>

I’m making pong as a mini project and came into a strange issue. While doing my score system I get the actor representing the score from “get all actors from class” node then “get” then set it’s text render plus 1 when a player scores.

 ![277344-screenshot-31.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/a/29a23b1853d5db54e4a06b9496680b0d13ad5a18.png)

 ![277343-screenshot-23.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/8/778b085700dcd9b9c6a6cd73b8471a040ca8cbdb.png)

This works fine, however, when I try to do the same thing for the opposite score actor I can’t connect the "get text render node as it does not appear, I instead need to directly cast to the score actor and change it.

 ![277345-screenshot-32.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/4/2c4f0281e407c0aab90063fa4256e1637beaaf40.png)

 ![277346-screenshot-24.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/f/47f43f58eafd4e7baa28afd7c5a0d583249a0235.png)

This still works in the end but I’m confused as to why I can get the text from just the “get” for one actor and not the other, the two actors are exactly the same other than the name, so I’m pretty stumped.

---

<div class="post-metadata">

**Author:** ![StreamLined](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StreamLined](https://forums.unrealengine.com/u/StreamLined)\
**Post date:** [May 19, 2019, 5:10pm UTC](https://forums.unrealengine.com/t/why-do-i-need-to-cast-to-one-actor-after-getting-it-from-a-class-but-not-the-other/449231/2 "2019-05-19T17:10:51Z")

</div>

Also the comments were mixed up at the time, so sorry if that causes confusion, but they’re irrelevent so just ignore them.

---

<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:** [May 19, 2019, 7:11pm UTC](https://forums.unrealengine.com/t/why-do-i-need-to-cast-to-one-actor-after-getting-it-from-a-class-but-not-the-other/449231/3 "2019-05-19T19:11:31Z")

</div>

My bet is that Right Score has a Text Render and Left Score does not.

Also, Get All returns correct class already, no need to cast at all. Sometimes if you copy / paste that node or use the filter, the node does not get updated correctly. Right click it and refresh manually.

---

<div class="post-metadata">

**Author:** ![StreamLined](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@StreamLined](https://forums.unrealengine.com/u/StreamLined)\
**Post date:** [May 19, 2019, 7:51pm UTC](https://forums.unrealengine.com/t/why-do-i-need-to-cast-to-one-actor-after-getting-it-from-a-class-but-not-the-other/449231/4 "2019-05-19T19:51:00Z")

</div>

As I said the two actors are exactly the same other than name so they both have text renders and I know I shouldn’t need to cast after getting it hence my confusion. Refreshing manually seems to have fixed the issue so I believe it was indeed some sort of copy paste problem so thank you for making me aware that that is a thing.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3c3739e8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3c3739e8](https://forums.unrealengine.com/u/anonymous_user_3c3739e8)\
**Post date:** [March 4, 2020, 9:10am UTC](https://forums.unrealengine.com/t/why-do-i-need-to-cast-to-one-actor-after-getting-it-from-a-class-but-not-the-other/449231/5 "2020-03-04T09:10:33Z")

</div>

i notice you need to compile, always do that after adding components or variables as it often fixes issues like that, may not this one but its good practice.
