Event ActorBeginOverlap not firing at times

Hello everyone. I created a very basic damage function for a spell. However, when I cast a spell directly on a target, it sometimes doesn’t continue the loop I created below, but always deals the first tick of damage. When I lead the target into the spell zone it always works without a problem. Is there a better thing to use than “Event ActorBeginOverlap” for this particular issue?

Applying damage

Setting damage

Thank you in advance for any advice!

This really depends on the spell. If it penetrates and thus moves on it can be outside the body before your next iteration.

Instead I would do something like add a damage debuff with a timer that ticks in the actor that is hit or use a line trace instead.

HTH

Those options aren’t very viable for a ground targeted spell. Most of the spells are going to be based on non homing mechanics. Therefore, I need an answer rather than a workaround solution, which yours are valid for a different system.

Would you know a better way to handle specifically actor collision rather than “Event Actor(Begin/End)Overlap”?

My answer is not really a workaround as I only gave you alternatives. I have no idea what the spell is supposed to do, how it works and what can affect it. You have to explain the exact usage and mechanics of the spell and the situation in which the problem arose. then I can help you more precisely.

I would also use a timer like NoobDeScroobs said. But first can you try using this setup, and tell me if anything changes?

That returns the same issue I had before. It works exactly the same though. As I’m having a little trouble explaining the problem. I made a video which may help explain it better.

Not sure if that is enough input to try to figure out my most likely silly error.

I understand, and yes, they are alternatives. I made a video that might help you pinpoint the issue visually, and I try my best to explain the issue in the video as well.

You hit it on the head. I’ll try GetOverlapingActors in the morning, it’s a bit late here. Yet, the enemy unit takes full damage if I’m not in the circle with it when it is standing still. Either way, it only registers one unit as taking damage at a time which is definitely not what I’m looking for.

This made it a lot clearer thank you. And also quite weird. There are two methods that come to my mind right away:

First, you can try to poll using GetOverlapingActors. Every time you tick the damage spell you call that node and apply the damage to all actors returned by it. Naturally, this can be heavy if you are going for a horde style game with many AOE spells and many characters. You can store each actor upon entering using OnActorBeginOverlap and remove them upon leaving and then simply send the damage to everyone in that list.

The second method is to reverse the problem. Upon entering the volume you get a timer and a damage debuff. Then you handle the damage yourself. Upon exiting the volume you simply remove that damage debuff and thus dont take any damage anymore.

As for why you are getting this problem. I believe it is because of how the engine handles overlap. Try placing the AOE spell such that it does not hit you and only the drone. Does that work? It might be attacking you instead. That being said, overlap detection during spawning is a bit finicky.

My engine is updating at the moment so I cant provide you with examples right now, but I will try to update my answer with screenshots when ready.

Please feel free to ask if you have any questions.

Good luck tomorrow. Also, I wanted to say this because it is a trait I feel we are missing on the answerhub: Thank you for being civil and properly informing us when asked to. A lot of people get cranky and give unclear and half-hearted explanations. That earned you my good will and some upvotes. :stuck_out_tongue:

I understand you want to fix your code issue, and I’ll try to help you with that, but on a side note there is something in UE4 pain causing volume, you might want to check it out

it looks like you damage is only applying once and not looping. The only reason why it’s continuous when you move, it’s because your actor is overlapping and un-overlapping over and over again while you move.
The issue is definitely due to how damage is applied, so that should narrow it down. You can either try to use a while loop with break or a branch instead of gate, but yeah a timer would be best. To make sure if it’s the gate issue, try connect the delay output directly to the apply damage input. This will create an endless loop, and UE4 will stop the game to break out of the infinite loop, but at least we will know if it’s working

Well, students aren’t know it alls, otherwise they’d be teachers. The fix of using Get Overlapping Actors works wonderfully. Now just to set classes to define ally/enemy ect. Different thing though. However, if anyone is looking for a fix I’ll leave the blueprint here. Thanks for the help again!