What I would also like to do is press T to toggle the visibility of the Lamp Static Mesh (SM_Recessed_Light). I was able to do that, but what is happening is if the lamp static mess is invisible, and I press G, then the spot light becomes visible and shines.
Does anyone know of a way I can modify either of these blueprints to make it so the spot light stays invisible when the lamp is invisible? If you have the answer, please could you be clear about what node should go where? Your help would be greatly appreciated. I’m still learning about blueprints and I am enjoying the journey, but it can get quite confusing at times.
short version, grab the static mesh ref and check ‘isvisible’ use this to decide what to do with your light
long version, any reason you’re using tick and not just input event? id recreate it all with two events, toggle mesh visibility and toggle light visibility and check on those events the state of the other
Thanks for the reply. Really, I’m new to this, so I’m just working with the nodes that I know. I’m sure there’s a better way to do everything I do. Where would I put the isvisible node? Also would I add that to the first image I shared or the second?
I am using Event Tick because it was used in the tutorial that I watched to turn on and off the lights
well without changing the way youve set it up, when you toggle the mesh off also toggle the light off there too
and then when you try to toggle the light on check first if the mesh is off using the (getmesh->isvisibile) node.
just a warning with your current set up they could get out of sync because you seem to be using a gate as a flipflop?
instead it would be better to track both visible states with a bool and invert it using a keypress. search for T and G Key it shold create an input event
I have two different materials on the bulb of the static mesh. One regular for the unlit bulb, and an emissive for when the bulb is on. That is why I am using the multigate. But I guess the original tutorial I watched didn’t have the addition of the 2nd button press to turn the mesh itself off.
I will try your tips and see if I can get it to work
So I think I was able to follow along with your advice.
It mostly works now. I started to experience the out of sync issue you mentioned with the light bulb material. I used a branch and is visible instead of the multigate.
Everything seems to work fine. The only issue is whenever I make the mesh visible again after pressing T, the lights are on, regardless if the lights were visible before the lamp mesh was made invisible. It’s really not a big deal, I’m fine with it the way it is, but is there a way that the lights can return to the invisible state when the lamp mesh is returned to being visible after pressing T?
Please be honest if what I did looks like a crazy mess!
oh its definitely a mess but thats part of learning haha what tutorial showed this example?
it looks like currently when you toggle the lamp on youre toggling the light on too.
for a simple quick fix i reckon you use hidden in game instead of visibility on the lamp. propagate it to children (assuming the light is a child of the lamp) that way youre using two different variables.