Why can't I turn off spotlight via blueprint?

Hello,

I have a pawn character with two spotlights (dynamic lighting map). This used to work, but for some reason it’s stopped working altogether and I can’t figure out why.

This is the blueprint component view:

(Scene Component)

  • Spot1 (movable)
  • Spot2 (movable)

This is the node that I’m using to control the lighting.

315311-image-176.png

Changing the visibility seems to do nothing and the light always stays on.
I can change the intensity via blueprint and that does affect the light, however toggling visibility seem to do nothing.

Any idea what might be going on here?

Thanks,
Krish.

Just to check, I made this:

315310-spot.gif

How is your different ( apart from being runtime I assume )?

Thanks @clockworkocean.

This does work in the editor (via construction script) but sadly not in the game (event graph). Any further ideas?

Alright, so I created an empty actor, stuck a spotlight in it, set the visibility to off (tried it directly on the component, via construction script and event graph)

This hid the light in the editor, but in PIE the light is on.

w.e.i.r.d - any ideas why this might be happening?

This is run time:

works fine.

Tried this already, and it doesn’t affect the light at all (for me) in runtime I’m afraid. :-\

How are you triggering the SetVisibility node?

wow that s pretty unexpected.maybe you should fill a bug report :slight_smile:

I’ve dug about bit more and it looks to be specific to the project itself.

I’ve tried moving to character to an empty project and the light works as intended, but I cannot get it working on the game project file.

I’m a bit lost as to how I can resolve this now :frowning:

Could there be some project settings that I might have accidentally toggled that is causing this issue I wonder?

@clockworkocean its defiantly triggering - it’s setup exactly as you have. (print string to double check that it’s doing what it’s intended to)

I’ve tested this a bit more, and in an empty level in the same project it works! so it looks like its limited to the game map I am on. I wonder if its some sort of dynamic/static lighting issue.

Okay, figured it out.

Show Collision console command disables the option to turn lights on and off in realtime.