Download

Need Help with my LightSwitch

I’m trying to communicate between 2 different blueprints so i can flip a switch on the wall and turn on my lights, i had this working before on a different map and it looks identical to what i currently have, but it’s just not working.

Light Switch =

Lights Themselves =

(Where it says on and off, last time i didn’t even use that, so i basically have that as a note to self)

Also, if anyone could point me in the right direction, I am also wanting to turn the Emissive map on and off on my material as well , Giving the illusion that the light is on and off ect.

Thanks in advance.

Regarding the emissive control, watch this video:

https://www.youtube.com/watch?v=srUSDU1u0og&list=PLZlv_N0_O1gbQjgY0nDwZNYe_N8IcYWS

Or open up the Blueprint Overview content examples map and see slide 1.5. Also the Blueprint Communication content example level has it too. The first few slides show MIDs and light toggling.

About your issue of the same blueprint not working, double check all the actor references on the placed blueprints themselves. Oftentimes it is easy to assume those are right when they could break with copying and pasting etc.

I have literally just redone all of the components but it’s still not working, any more suggestions would be great.

Hmm you said this was working in another map, but I see some weirdness. Normally “visibility” is not used with a spotlight or pointlight, you would toggle enabled or set brightness to 0. Visibility would be used with a static mesh. Could that be your issue?

Also, you should keep that light BP graph up while simulating in the editor to see if the event fires when you click like it should. The link coming out of the “ToggleLights” event should light up and animate for a second. Then you can narrow down the problem a bit if that does or does not happen.

The last time i did it it was following one of the Ue4 Youtube tutorials which did switch the “visibility”, i also just changed visibility to “set Brightness” and changed the value to 0, and no change, i have also watched the blueprint in real time, it’s allowing me input when i enter the trigger, F itself is also triggering correctly, but it stops once it hits the “toggle Lights” which is a custom event i created.

EDIT: Odd, i also just tried adding “F” to toggle light in just the lights blueprint, but it does not work… Have i somehow disabled this blueprint or something?

Second EDIT: i have a possible feeling of what the problem could be, i just remembered i created my own player controller and playerpawn, maybe somewhere i havent checked that i can press “f” for example…, i have checked the main Allow Mouse/touch inputs ect, but that does not fix the problem.

If F is causing the other graph to light up, I doubt that is your issue. Seems to be the light function or the event is not firing form one BP to another for some reason.

Try this for debugging: right click inside if your light BP and create a “Custom Event” Name this something like “togglelights” and link it to the ToggleVisilibity node.

Then play your game and type “ke * togglelights” and check to see if it fires the visibility node.

The F key is only toggling the Call to the Toggle Lights from the lightswitch blueprint, the ToggleLights event that i created in the actual lights blueprint does not fire, i also just tried typing the ToggleLights call into the console window and still no luck sadly

When you place an instance of these BPs into the level, are you editing the properties of the LightSwitch instance to set the TargetLights variable to point at the TwinLight instance?

This has been bothering me for so long. thanks for jogging my memory, to clarify, i edited the details of the lightswitch to define the lights under the dropdown menu, thanks alot.