overlap events on many instances of same actor

Hello! just a beginner question, cant seem to figure out why this is happening. I have variable amount of instances of same actor in the game and im trying to generate a separate overlap event for each one of them. I have this in the actor blueprint.

why am i still getting barraged with many overlap events on each pass? theres also something funky happening on the transition, but hopefully sorting out one event per pass will help that

Ok- I’m not even slightly confident in knowing what you’re trying to do. Could you clarify?
I’m not sure what you mean by

im trying to generate a separate overlap event for each one of them.

I’d prefer if you also say what the spheres are meant to be/do- it’ll clarify a lot.


I read your blueprint and all it’s doing is:

Overlapped Something! → Was it a ball? → if yes, have we already overlapped a ball before? → if no, we now have so set the variable to true and print.

Finished Overlapping Something! → Was it a ball? → if yes, have we overlapped a ball before? (redundant) → if yes, now we have not overlapped any ball ever.

This would cause [set overlap occurred to true] to only trigger the first time this sphere ever overlaps with another ball, and [set overlap occurred to false] to only trigger when the last ball stops overlapping.
I’m pretty sure this isn’t what you want, else you could just replace it with this:
image

Hello, thank you for the reply. Sorry if the question was a bit confusing. the ultimate goal of this is - the spheres orbiting the character each having their own health bars and taking damage upon overlap with another pawn (the 2nd character in the video is enemy character).

what i was trying to do is first get exactly which ball has overlapped the enemy then start working on the --health part. The print in the blueprint is only printing when the sphere overlaps the enemy character.

Its easiest to think of the spheres as orbiting projectiles that can pass through enemy and would be destroyed after multiple passes.

Okay- I get that.

I would definitely recommend making these spheres their own class, and do it like below:

First, add a sphere component. Make sure it’s at 0,0,0 location. You’ll probably want to lower the scale down from 1
image

Second, we make our variables.
I’ve added Health and Damage. If you ever want to heal these balls, you’ll also need to have a max health variable.
image

Finishing that, we’ll create our damaging function. I’m using unreal’s built in damage system for this example, but it’s fine if you use something else.

With damage receiving implemented, we can add the damage dealing part. This’ll just happen on Begin Overlap. There is no point in using end overlap in our case.


We check if it’s an enemy (in this case by casting, but if you have some other way to check, that’s fine too), apply damage to it, and then apply damage to self.
In the result image at the bottom, I’m also printing after we apply damage to self.



Now that we have our balls class, we create a scene component in our player
image

Next, set the rotation from relative to world. This’ll prevent the spheres from obnoxiously rotating with the player
image

Following that, we actually spawn the balls now


We spawn the balls, attach them to our scene component, add them to our array, and set the location to be in a perfect circle around the player.

To rotate the balls, simply add rotation to the ball holder component:



Result (with 8 balls at 100 distance):

2 Likes

Thank you so much for the answer. This works great! and the whole process you used is so much cleaner.

Thanks again!

1 Like