Turning off multiple lights with a single Trigger?
Hello fellow UE Users,
I'm currently trying to get the following working:
I have a single Blueprint called "Light1" (a model, a light source and a sound). I placed it a couple of times in a map. I have another Blueprint called "TriggerLight" which currently only has a Trigger Volume.
I'm trying to get the following working:
The player hits TriggerLight and ALL instances of Light1 turn off. Maybe even plays a sound.
I'm really stuck with "broadcasting" this to all instances of Light1.
Any help would be highly appreciated.
asked Jun 09 '15 at 09:05 PM in Blueprint Scripting
I would suggest taking a look at our Content Examples, specifically the 'Blueprint _Communication' map. 1.4 - Communicating with all actors of a specific class will give you the answers that you need regarding turning on and off multiple lights with one single trigger.
Basically, you're going to need to set up an 'OnComponentBeginOverlap (Trigger Collision)' as well as an 'OnComponentEndOverlap (Trigger Collision)', which will need to be added into a flip/flop, set to a 'Scalar Parameter Value', attached to 'Get All Actors of Class' and 'For Each Loop' you'll need to 'Cast to (Blueprint)' and set an event to toggle the light on or off. This will require two sets of each node you're setting up mostly, since it's for turning on and off a light, or multiple lights.
answered Jun 09 '15 at 09:22 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here