# Get actor of class not working when variable plugged in.

**URL:** <https://forums.unrealengine.com/t/get-actor-of-class-not-working-when-variable-plugged-in/1884084>\
**Category:** Blueprint\
**Tags:** node, unreal-engine, Blueprint, question\
**Created:** [June 1, 2024, 2:50pm UTC](https://forums.unrealengine.com/t/get-actor-of-class-not-working-when-variable-plugged-in/1884084 "2024-06-01T14:50:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![POOPER33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pooper33/32/944408_2.png) [@POOPER33](https://forums.unrealengine.com/u/POOPER33)\
**Post date:** [June 1, 2024, 2:50pm UTC](https://forums.unrealengine.com/t/get-actor-of-class-not-working-when-variable-plugged-in/1884084/1 "2024-06-01T14:50:34Z")

</div>

Hey guys, so I ran into something kind of annoying. “Get Actor Of Class” works fine when I specify actor class in the input pin. But it does not work when i plug in a variable or from a data table.

I’m trying to get the actor “BP Generator” and call an Event dispatcher called “Call Turn Off” from THIS blueprint that is “Event Manager”.

The problem is that the output pin of “Get actor of class” changes from “BP Generator Object Reference” to “Actor Object Reference” when I plug in the class variable. Therefore I can’t call the “Call Turn Off”

Is there any way around this problem that I’m not seeing?

FYI- Actor is already Loaded in the level, and the array is not empty.

 ![Screenshot 2024-06-01 104024](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/3/943bbeb44e65dca25b17aab4f2c61d5479a73b8b.png)  
 ![Screenshot 2024-06-01 104037](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/e/d8e6db2c3ad00ff4b98ca1542478ebbe3c4d26e1.png)

---

<div class="post-metadata">

**Author:** ![baobao4435](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/baobao4435/32/950790_2.png) [@baobao4435](https://forums.unrealengine.com/u/baobao4435)\
**Post date:** [June 1, 2024, 3:46pm UTC](https://forums.unrealengine.com/t/get-actor-of-class-not-working-when-variable-plugged-in/1884084/2 "2024-06-01T15:46:49Z")

</div>

Try to change actor class to “BP Generator” class in the structure used by the data table

and data table storing hard class is not a good idea,sometimes it makes the data table very huge.better to make the classes soft .

---

<div class="post-metadata">

**Author:** ![POOPER33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pooper33/32/944408_2.png) [@POOPER33](https://forums.unrealengine.com/u/POOPER33)\
**Post date:** [June 1, 2024, 4:41pm UTC](https://forums.unrealengine.com/t/get-actor-of-class-not-working-when-variable-plugged-in/1884084/3 "2024-06-01T16:41:39Z")

</div>

I thought of that, but that wont be the only actor I’ll need reference too.

Yes storing hard reference in data table doesn’t sound like a good idea… lol

---

<div class="post-metadata">

**Author:** ![baobao4435](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/baobao4435/32/950790_2.png) [@baobao4435](https://forums.unrealengine.com/u/baobao4435)\
**Post date:** [June 1, 2024, 4:58pm UTC](https://forums.unrealengine.com/t/get-actor-of-class-not-working-when-variable-plugged-in/1884084/4 "2024-06-01T16:58:51Z")

</div>

oh sorry I didn’t notice you were trying to call an dispatcher,I thought it was binding.

you can create an interface to interact with them.no matter what type they are.

like so :

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/a/e9a7366b976ad7134f4c5c90683e7da719bf0129.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/2/792dcf4c5c6996555727913cabc34ff5c7a11bf4.jpeg)

---

<div class="post-metadata">

**Author:** ![POOPER33](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pooper33/32/944408_2.png) [@POOPER33](https://forums.unrealengine.com/u/POOPER33)\
**Post date:** [June 1, 2024, 5:10pm UTC](https://forums.unrealengine.com/t/get-actor-of-class-not-working-when-variable-plugged-in/1884084/5 "2024-06-01T17:10:58Z")

</div>

That’s it, it worked!! Interfaces do work with no matter the class!

Event dispatcher was were i went wrong.

Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [July 1, 2024, 5:11pm UTC](https://forums.unrealengine.com/t/get-actor-of-class-not-working-when-variable-plugged-in/1884084/6 "2024-07-01T17:11:03Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
