How to combine Line Trace and Box Collision Overlap

Hi Guys !
This is my first project with Unreal and all goes more than well, but I’ve come to a point where I can’t find any resources or information to continue.

The situation is as it goes:

I have a set of lamps in an interior scene, so I made them to turn on and off by a key only if you look at the lamps ( LightTraceByChannel), so everything is great, but now I want to make the light trace or maybe the button input to work only when I am in a specific areas (near light switches of course ), tried adding a “OnComponentBeginOverlap” but it doesn’t seem to work or I am doing it wrong. (the highlighted in red nodes are the lamp custom event just for easier orientation)
Any suggestions, and do please explain like to a 4 year old, this is my first Unreal project and I come from a 3d background only, no coding.

Here are a few screens showing my Lamp Blueprint (where my custom event is) and my Character Blueprint (where my Line Trace is)
And a third screen just to show off the project on the left is Unreal, on the right is VRay :slight_smile:

Thank you in advance !

1 Like
  • Use the Gate node.
  • When you enter an area (as triggered by the collision), call Open on the gate.
  • When you leave the area, call Close on the gate.
  • When you try to use Toggle the lightswitch, call Enter on the gate.
  • Have the Gate’s input call the toggle light switch event or function.
  • You’ll want the Gate to Start Closed if you don’t start in the area.
1 Like

Thank you Ben I really appreciate it !

Glad it worked for you!