Assign custom trigger volume to Class Blueprint?

Hello there, I’m new in UE4 but with help of tutorials I’d been able to make nice things for my game.

I’d been trying to create a Class Blueprint for a lightbulb that turns on/off when you enter the room, I want to re-use this in rooms of different sizes, so I’d been trying to use Construction Script so I can manually assign an external trigger box… Something like “Change Static Mesh”.
However, in the Details Panel I can’t assign anything at all…

Can someone please point me into the right direction?
Thanks in advance.

A trigger box is not a mesh so you can’t set it like this, and to see variables when you place an object in the world you have to tick the eye at the right side of the variable you want to expose. You can expose it on spawn too if you need this variable when you spawn it at runtime

For you trigger system I’d recommand you to have two separated BPs, one s the light blueprint with all the construction script and a boolean to tell the trigger if the light is on or off and another with the trigger box and as variable an array of your light BP, then you can do something like this

And you can add a do once node or a branch with a boolean exposed at the beginning if you want some triggerboxes to trigger only once

building on this idea or as a slight alternative i made a few small scripts. The basic thing here is that scripts are made to control lights in the level without needing to make them blueprints if you dont want to. for both scripts there is a box collision that triggers the turning on and off of the lights and the lights are stored in a array. the array type i used in this case was of the type pointlight but could easily be set to actor instead and it is set to editable so when this bp is placed in the level you just need to go to the default section of the details panel and add lights to the array list.

so for the first script i did basically the same as charly above but i made it so when you begin overlap the lights turn on and when you end overlap the lights turn off. i also prefer to change the light intensity but thats just my personal preference. also note with this method the default state of the lights is off so i have the intensity set to zero to start.

method two is a bit fancier. this method involves using a timeline to control the lights intensity. the effect here is that the lights go from 0 intensity to full intensity over the course of one second. this creates a slightly softer less jarring effect. the basics of the script are the same as before but this time the intensity is driven by the timeline which is a curve that goes from 0 to 1 over a given time. this also allows the use of play form start (0-5000) and play from end (5000-0) so you can use less nodes. it may be little harder to understand this one but its not too complex.

this last picture just shows where to add lights to the array.

231984-capture3.png

Never thought to fill a room with a triggerbox to let the light on when you enter and off when you leave…

Gotta use this idea, once again Cheers!

you could do the same thing with a switch on the wall as well. i think theres even a tutorial that uses a light switch