Select light actors inside a volume (box collision) IN EDITOR?

Hello people!

I’m working with editor utility actors (Blutility :D) inside Unreal engine 5.

I have created an editor utility actor which contains a box collision , and I would like it to select all the light actors (spotlights and pointlights) inside the box, when it overlaps with the actors.

Is there a way to detect overlaps between the box collision and the spotlight actors while in the editor (not at runtime)?

Thanks in advance :slight_smile:

Can you use ‘get overlapping actors’, rather than waiting for a runtime overlap?

I’m using get overlapping actors linked to the box collision and cycling through (for each) the supposed overlapped actors, and to debug i’m printing their name (get display name ) and triggering the script with a custom event.
The actors I have in the scene are just point lights and spotlights and when I trigger the custom event it won’t find them :frowning:

Ah, they don’t overlap… I guess you could get all the lights in the scene and check for distance instead?

I thought about a similar option. Which is basically calculating the location of the box edges, and than compare it against the location of the light. I thought about calculating the distance between the light/box and the main origin axis (0,0,0) and if the light location distance is inside the range of the box distance, then it is inside. Although this method is quite complex since you have to evaluate in all 3 directions.
I was wondering if there’s an easier solution?

I wasn’t even thinking about the box, just distance.

If you want to use the box and overlap, then you could put the lights in blueprints with a collision sphere?

Oh! So you get the origin locations of the lights and the box and you check the distance?

Creating an actor with a sphere collision component in it will create overlaps with the box BUT only at runtime for what I tested unfortunately :frowning:

yis


Actually the distance won’t discriminate among the axes, so it wouldn’t work with my case.
Using an inverse transform fixed my issue :slight_smile:
I am then using ABS for the output of my inverse transform and comparing it with my box scale to understand if the component it’s in or out, and that works perfectly :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.