I want my player as he moves to detect all point lights in a certain radius as an Overlap Sphere would work with actors.
I have what I want working by getting the point lights by class and running a foreachloop and checking the distance to the player. From there I have everything working. However, this seems a very costly way to do it?
Is there any equivalent to the Overlap Sphere that works with point lights, or similar alternative, I could use (Blueprint of course)? If so could you please point me in the right direction?
I tried attaching the point lights to other actors and finding them via overlap sphere, but so far I have failed to get from the array of correct actors to get to an array of their point lights!
Note that you shouldn’t use event tick like I do, at least not every tick. Also, you can make a custom object type if you need to.
If you want a more efficient way of doing it, you could just create an overlap component on the player and if a light enters overlap, add it to an array, and remove it on end overlap.
Finally, the reason overlap events weren’t working for your point lights is because … they don’t exist as an actor that can be overlapped, due to having no collision, if that makes sense. You’ll need to make a blueprint and add a collision sphere. Default object type should be WorldDynamic, although like I said you can make your own if you need to.
Thank you, you are correct, I just needed to add collision to the point lights.
I am being fooled by a warning I am getting, that seems to be a bug. The blueprint compiles and runs fine, but when I exit UE and then return there are warnings, but it still works as expected. If I replace the nodes with warnings with themselves, the warning go until I reopen the program again! In short, I thought I was failing to write my light array script, but in reality I wasn’t - this I will file in bugs though and they can tell me if it is my fault!