I have this Sun lamp in my scene. I need to toggle the visibility of the lamp with the press of a button. I tried using the Visibility actuator, but it does not remove my lamp because visibility in the Physics panel does not apply to lamp values. I thought of a few ways of toggling the visibility of it, but could not get any of them working:
- Move lamp to another layer on the same scene
- Delete lamp and re-spawn it (I tried
endObject()but it would never remove the object)
- Change the lamp's brightness value
Remember, this is going to be on a button, so it has to be re-spawnable. If I could get the base code, I can make the toggleable
if block myself. Also, this is a Python question. Logic blocks take more time to setup than just a simple script. ;)
Thanks in advance!