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)?
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
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?
Actually the distance won’t discriminate among the axes, so it wouldn’t work with my case.
Using an inverse transform fixed my issue
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