# "CAST" FOR BIND DISPATCHER

**URL:** <https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742>\
**Category:** Blueprint\
**Tags:** reference, casting, event-dispatcher, unreal-engine, Blueprint, question\
**Created:** [April 30, 2025, 6:40am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742 "2025-04-30T06:40:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 6:40am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/1 "2025-04-30T06:40:53Z")

</div>

Hello ev! 🙂

I made a bp that takes all the most used bp’s refs in my project, to avoid having too many get actors of class x times in each of them, to keep everything lighter. So, this bp takes all the refs and transmit them via Blueprint Interface. Now the problems is when I must use refs on binds, because a bind needs a strong,persistent and specific reference while I write refs in run time as variables, and this is a problem, infact the variable results not compatible on bind even if it’s the same bp obj ref where the call dispatcher is done. Actually I “solved” itering each ref with “cast to” and in case the cast is not failed and “as bp i need” is valid, I set “as bp” as the variable for the bind. This solved both the incompatibility issue and all the error messages I had in the log regarding K2node.

Up until now I’ve worked to avoid CASTs like hell, in this case I found myself forced.

So, now my questions are : Is wrong to use CAST node in this way? And also, Is there a better way to solve this kind of issue?

 ![Screenshot (358)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/9/c/c9cd2d0dd6003d136c10e104d695500cc8fe7580.png)

Thank y’all so much! 🙏

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 7:03am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/2 "2025-04-30T07:03:38Z")

</div>

> [@Cykablatta](#):
>
> avoid CASTs

If Cast create a dependency that drags 10GB of textures or something like that along with it - then you MAY want to think about it. Avoiding it doesn’t always make real sense…

> [@Cykablatta](#):
>
> better way

You can make something like an “interface” for the delegate. Just put it in the actor component, then you can call Get Component By Class and bind to the delegate in the component.  
In this case, you don’t need to cast to actors. All you need is for them to have a component with a delegate.

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 7:12am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/3 "2025-04-30T07:12:08Z")

</div>

@PREDALIEN  
let’s say I got into the habit of using it as little as possible because I knew it could compromise performance and that there were other ways to achieve the same thing. Leaving aside the cast, if I did as you suggested, wouldn’t the bp that takes and validates the refs be useless? And can a component really be the target of a bind? I thought that the targets had to necessarily be the bp that make the call.

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 7:52am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/4 "2025-04-30T07:52:29Z")

</div>

Using the Create Event node you can bind events/functions from other objects to the delegate, not just your own.

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 8:15am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/5 "2025-04-30T08:15:59Z")

</div>

Probably I missunderstood what you meant for component. I’m a bit confused.

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 8:21am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/6 "2025-04-30T08:21:37Z")

</div>

Actor Component blueprint:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/5/b/f5ba5b564a462c823a6542eec3bc168390a3b8f9.png)

Using:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/0/2e039d0297e37cd8c0253b61978f6bd2dc90ac98.png)

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 8:42am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/7 "2025-04-30T08:42:27Z")

</div>

So it is no longer convenient for me to create dispatchers inside the bp that make the calls, but for each one I need, I should create a bp of type actor component and insert the dispatcher inside it. Is this what you meant?

It’s the first time for me with this kind of bp.

@PREDALIEN

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 8:46am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/8 "2025-04-30T08:46:07Z")

</div>

> [@Cykablatta](#):
>
> Is this what you meant?

Yes, you create one (or more if they return different parameters (different signatures)) component class and then use it in all actors where needed.

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 9:10am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/9 "2025-04-30T09:10:28Z")

</div>

> [@PREDALIEN](#):
>
> Yes, you create one (or more if they return different parameters (different signatures)) component class and then use it in all actors where needed.

Once created how can I implement them in the bp that need them? Like bpi? @PREDALIEN

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 9:21am UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/10 "2025-04-30T09:21:40Z")

</div>

> [@Cykablatta](#):
>
> how can I implement them in the bp

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/3/84388f5673adbd76bbf827e955d35a90832785ca.png)

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 12:50pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/11 "2025-04-30T12:50:37Z")

</div>

At this point in the bp that takes all the refs, I take both the direct actor object refs and the ref actor components, I take them all together and transmit them according to you? With variables in run time, won’t it give the same problem?

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 1:00pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/12 "2025-04-30T13:00:11Z")

</div>

I didn’t quite understand you.

Can you show the code you got?

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 1:12pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/13 "2025-04-30T13:12:21Z")

</div>

> [@Cykablatta](#):
>
> So, this bp takes all the refs and transmit them via Blueprint Interface. Now the problems is when I must use refs on binds, because a bind needs a strong,persistent and specific reference while I write refs in run time as variables

I mean this I described at the beginning. I forgot to say, bps I’m talking about, are the same (dragged and dropped) for any level, but in debug mode, I just noticed they’ve a different alpha-numeric suffix. Could be this one the problem?

 ![Screenshot (359)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/b/dbbf126fbbf597a75a8aa65363d2e2ced171efc5.png)  
 ![Screenshot (360)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/a/e/5aec5788b934fcba665aba1e7459c0a28616c631.png)  
 ![Screenshot (361)](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/1/291ad1e4bde05ebea2813341d3d1f0bc62c0d01d.png)

@PREDALIEN

It takes bp refs, add them in array, for each target send to it all refs. Then each bp filters and discard self ref. Now each of them have valid refs to use for binds, bpi eccetera…This was my idea.

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 1:42pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/14 "2025-04-30T13:42:59Z")

</div>

You need to get all actors (base class “Actor”), and in the loop find the component with the dispatcher in them. You need to save references to the found component, not to the actors.

Can you clarify what exactly you are trying to do? The knot in my head is getting tangled… 🫠

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 2:10pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/15 "2025-04-30T14:10:22Z")

</div>

I’m trying to avoid having too many and repetitive “get actors”. So my idea was to have one single bp that takes all main bps refs and trasmit them to these same bp. For future use, for bind, for bpi eccetera. So get is done once for all, and each bp has the refs from the beginning. I kept this kind of ref because the target needed was “actor obj ref”. @PREDALIEN

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 2:13pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/16 "2025-04-30T14:13:17Z")

</div>

So now my question is, if I have blueprints in common between multiple levels, and instead of spawning them once at runtime in the current level, I drag and drop them one by one in the various levels to reuse them, it’s still as if they are not the same, and therefore I have to do get all actors of class instead of get actor? Is this what are you telling me? @PREDALIEN

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 2:43pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/17 "2025-04-30T14:43:06Z")

</div>

> [@Cykablatta](#):
>
> I’m trying to avoid having too many and repetitive “get actors”

You can use soft references of actors instead, which will be chosen in advance. 🤔  
(Hard ones are also possible, but the actors must be on the same level)

> [@Cykablatta](#):
>
> it’s still as if they are not the same

At different levels there are different actors (even if (because) you copied them), they have different paths (reference).

You can (should?) put common actors on a separate level. Copying is evil.

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 5:19pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/18 "2025-04-30T17:19:51Z")

</div>

I have to choose whether to use soft references in run time, for identical bp but dragged and dropped in each level, or keep hard refs, keeping all common bp in a persistent level and then spawning them in run time, is this correct?

@PREDALIEN 🤕

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 6:17pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/19 "2025-04-30T18:17:24Z")

</div>

You need to create a separate level for common actors that are needed at different levels.

Then make soft reference variables of these actors and choose them in advance.

Then do a Resolve of the soft reference, and if the level is loaded (the actor exists) - you will get a hard reference on the actor.

---

<div class="post-metadata">

**Author:** ![Cykablatta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Cykablatta](https://forums.unrealengine.com/u/Cykablatta)\
**Post date:** [April 30, 2025, 6:39pm UTC](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742/20 "2025-04-30T18:39:35Z")

</div>

> [@PREDALIEN](#):
>
> and if the level is loaded (the actor exists)

I’m confused. I’ve never worked with levels before. In another thread I asked what I should worry about to best reuse the same bps on different levels, and I was told that I could just drag and drop them. Nothing else. I apologize if I’m being boring, but I want to make sure I don’t make things worse with my code and destroy months of work.

[Next page](https://forums.unrealengine.com/t/cast-for-bind-dispatcher/2482742.md?page=2)
