Sphere collision overlap

Hi guys, is it possible to constantly keep checking if a certain actor is overlapped by a sphere collision?
I’ve set up a sphere collision which checks if it’s overlapping an actor with a certain interface, the problem is, when it overlaps, take for instance, two actors with the same interface and one of them suddenly leaves the overlap, it sets my variable to false even though it’s still currently overlapping one of them.
Note, I set up a variable to be true if it does overlap the actor with the interface and on end overlap, it sets the variable to false.

You can either make an array and add the overlapped sphere whenever you start overlapping and remove it whenever you end overlapping, or use a counter and increment/decrement from it.
To get the variable you want, just check whether the array is empty or the counter is 0 respectively.

If the spheres are their own class, you can also just use get overlapping actors and filter for only them:

1 Like

Sorry, I’m still confused about this, I couldn’t even find the isempty and isnotempty nodes

If that’s the case, you should probably go with the increment decrement approach:

1 Like

Yeah I tried using this method but for some reason overlapping one actor gives me a value of 6, is there a way to make it to give give me just 1 value per actor overlapped, it gives 6 per actor

Make sure to use add unique, not add:

I also tried this approach, I couldn’t find the is not empty node, I’m using unreal engine 4.26 and I unticked the context sensitive, I still didn’t see it

Alright lemme try it out

Thanks alot, it works perfectly :slightly_smiling_face:

1 Like