Forum rules - please read before posting.

How to use the "Light Switch" component?

edited April 2020 in Technical Q&A

Hi,

In my scene i use a 2D (experimental) light which is On at start.
I want to switch it off with a hotspot.
I attached a “Light Switch” component to the 2D light and I check the “Enable On Start” box.

  • btw by doing that... it adds an extra second light component together with the light switch on my inspector. Why?

Then on my hotspot action list I use “Object>Send message>mylight>Turn Off.
Nothing seems to happen when I use the hotspot.
I checked the 8.8 chapter of the manual and i know i can achieve this by animating the intensity.
But i'm curious please to see what am i doing wrong.

Thanks
:-)

Comments

  • The LightSwitch component is meant for standard Unity Light components - not for Unity's experimenal 2D light system, which is a separate system on a technical level.

    Animating the intensity via an Animator, and then controlling playback with the Object: Animate Action, would indeed be the way to go.

  • Thank you very much Chris, problem solved.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.