- Home /
[CLOSED] Change intensity of a light with script (which isn´t attached to the light object)
(Sry, maybe my English isn´t perfect)
Hi, I want to change the intensity of a light (Gameobject with only a light component) when I click on an object. I know how to do that (I use OnMouseDown), but how do I change the intensity of a light?
I need two variables, the object/component and the intensity.
Thank you!
Comment
Sorry, I just forgot something in the script, it works ^^
Answer by Yofurioso · Jul 17, 2014 at 02:03 PM
Just check if the "clicked" object has a Light component, and if it does change the intensity of said Light component. Hope it helps