How can I make two specific colliders cause an overlap event

Hey all,

I’ve been trying to wrack my brain into how I can make it so when one collider starts to overlaps another specific collider, to turn on dynamic lights and when it stops overlapping, it turns the dynamic lights off.

I’m trying to achieve this so I can have full dynamic lights on in my level but want to optimize it so that the shadows are only enabled when the camera is looking in there direction. I have a cone attached to my camera, spheres around the lights and tried to make it so when they overlap it does it but I’m clearly missing something.

Thanks!

Can you specify what exactly is the problem you are facing? With Overlap events? or Toggling the lights?

Overlap events i would say more, i tried to make it just print a string when it overlapped but that never worked so i knew i was doing something wrong.

In both your Colliders, make sure you have checked “Generate Overlap Events” in their details panel.

Yeah they are indeed both set. I think my problem might be making them both communicate with each other.

You can try adding a trigger box or box collision around other collider,and on its overlap perform the function. I too faced this problem where my character was walking on certain floor tile but overlap event was not getting fired. So I used trigger box in that case.

Right well trigger box is working a lot better then what i was using before haha now i can indeed get it to print strings if i am looking at or away from the trigger box.

http://i.imgur.com/zLoANSe.png

Main thing now is to make it so it can reference the light blueprint I have so it can turn on and off the dynamic shadows. Since this is a top down game, I will prob need a different blueprint for each room to make sure only the rooms that are not being looked at turn off there shadows.

You can cast to your Light BP and get its reference to turn on and off the light.
Also please accept the answer, if you think it helped.

Perhaps create a new BP extended from Actor. Add a Light component and a trigger volume in it. Then you implement the light toggle logic in it by overriding the OnBeginOverlap and OnEndOverlap events.
Then you can place many instances of this BP and they will all behave the same way,

hmm i set it to cast to the BP and it’s not working. Also I can’t seem to find a node to effect dynamic shadows on or off, do you know which I should use?

http://i.imgur.com/yVgtlQA.png

Actually never mind, i found that changing cast shadows works but I had dynamic lighting set to off so it couldn’t ever switch it on through blueprints. It seems to be working now but only if I try and make reference on of the blueprints in the level. Is there a way to make it globally on all BP of that type?

http://i.imgur.com/8sBJnqz.png

You need to create an object for your light blueprint and pass it as object while casting. To turn on/off light , you can change intensity or brightness of light

Hmm I’m sorry, I’m not sure I’m following you haha I’ve got the light stuff down at least, I’m just not sure how to make it cast to the light blueprint.

Yes. Make a Blueprint with all these elements in it (light , trigger box) and add On Overlap event within this Blueprint to perform the functionality. Then you can add this BP anywhere in your level just by dragging it to the target location and same functionality will be performed.

Yep you guys are completely right haha works perfectly! thank you guys so much :smiley: