[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!

Just check if the “clicked” object has a Light component, and if it does change the intensity of said Light component. Hope it helps