Ai overlapping with object = damaging you

hello! so im making a game where you have to protect a beehive in the middle of the map and ai characters spawn and attack it. So basically i want them to go there and when they overlap with the object, they deal damage every second. Everything seems to make sense to me but i cannot figure out how to add the player character as “damaged actor” in the apply damage node in the beehive’s blueprint. I tried with a variable and selecting the reference of the Player_BP but it didnt work…

Is there something im missing or how can i add the reference Player_BP in another blueprint (in this case, the beehive)?

What you have there will damage the player, when the player overlaps.

Do you have the corresponding event in the player?

image

If you want them to damage the player (through the beehive) every second, you should be handling that in the attacker script, not the beehive script.

It should look something like this:

Don’t forget to implement the AnyDamage event on the player.
image

this is what i have in the player

If you put a print string here, does it trigger?

yes it works

So you mean in the player script? But how would i add the overlap nodes? The player moves around the map and the beehive is in the middle stationary.

I misunderstood. I mean on the attackers themselves.

So i add the overlap nodes on the attackers. And how do i apply the damage to the player when they attack the beehive? And how do i say that this only happens when they overlap with the beehive and nothing else?

If you to know step-by-step, take a look at the image I sent prior.

What you can do is check whether the overlapped actor is of the beehive class.

Okay i see, so basically like a branch to see if the overlap is on the beehive. How did you add it in this blueprint? Is it a newly created variable with the class reference to the beehive or how?

You don’t need the variable since you won’t be changing that class, I just don’t have a beehive class to reference and didn’t want to confuse you by checking whether it’s something random.

There’s a dropdown menu when checking if classes are equal, so you can just pick the beehive class from there

Ahh right, i will try it and let you know. Thanks so far!

This worked flawlessly! thank you very very much !

Np! glad I could help.