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?