How to reference a BP from another BP?

I’ve done quite a bit of research trying to find an answer to this question. It seems like the answer should be quite simple, and there are lots of similar questions I’ve found, but none of the solutions seem to work. Even the examples in the Unreal documentation don’t work like they say they should.

What I want: I’m making an RPG-style game. In my game, I have a projectile (Blast) which is spawned from a player character (Paladin). This part works fine. When the Blast projectile overlaps an enemy, I want that enemy’s movement component (they are all character blueprints) to be deactivated for five seconds, and then reactivate. Essentially, I want the Paladin to be able to shoot a Blast which roots enemies in place for five seconds. This is the part which I can’t get to work.

What I’ve tried: The issue is that I can’t seem to get a handle on references. The way I see it, there are two ways I can do this: I can use the Blast BP to say that when it overlaps an actor, that actor is rooted. Or I can use the enemy BPs to say that when they are overlapping by the Blast, they are rooted. But either way, I have to somehow get a reference to something not in the current blueprint. I’ve tried casting, but because the enemies/Blast aren’t player characters, I have nothing to fill the Object pin with. So the cast always fails. I’ve tried creating variables to the Blast, and creating Overlap events for those variables. The events never fire.

I think I need to let someone explain to me the best way to do this, so that I can see where I’m going wrong.

Note: Part of the problem is that neither BP is controlled by a player. Most examples I see deal with casting to the player character, but that won’t work in this case, because neither of my BPs are controlled by the player.

Question: How does one reference one non-player BP from another non-player BP?

Yep, I knew it had to be something simple. That works. Thanks. If you make that comment an answer, I’ll mark it.

Yes, that’s the idea. I just don’t know how to do that.

Either the blast knows when it overlaps ( or hits ) an enemy, or the enemy knows when it is hit by a blast, right?

Well, the enemy can have a collision volume, and when it gets hit:

Boom, that’s it, your reference to the blast.

1 Like

@ClockworkOcean Quick question - I’m trying to do basically the same thing as before, except there’s no projectile this time. I’m trying to just check if an AnyDamage node is being triggered by the collision on a certain BP. I’m connecting the Object pin on the Cast node to the Damage Causer pin on the AnyDamage node, but the cast just keeps failing. I WANT it to fail if the damage is not being caused by the specified collision, but how do I get it to succeed if the damage IS being caused by that specific collision?

So when the BPs collide, BPa calls ApplyDamage on BPb?

Then you don’t need to check, it will just trigger the EventAnyDamage node in BPb.

That’s the first thing I tried, but the cast just fails. I think this is basically it’s own question by now; I’ll go ahead and make it one. I’ll include screenshots of what I’m talking about.
Typically, the cast works in the other blueprint. But now the stun doesn’t work. So that’s my new question, which I’ve posted.

Yeah but I’m trying to make BPa inflict a stun on BPb. Sorry, should have clarified that. BPb calls damage, but I need a way to check if the thing causing damage is BPa. If it is, then the stun occurs. If it’s not, then BPb just takes the damage as normal.
Either that or a way to reference the enemy being hit by BPa - but there don’t seem to be any casting options for the AI enemies, just the player BPs.

You can tell which actor did the damage from:

327890-screenshot-5.jpg