Greetings Im trying to toggle between two States “Day” and “Night” when pressing a button, but im struggling with the code. So far it switches to the “Night” State okay but pressing the button again does nothing.
My code looks like this:
var DayNight_Day = symbol.controllers.DayNight.elements.Day;
var DayNight_Night = symbol.controllers.DayNight.elements.Night;
parent.on(“pointerdown”, (e) => {
if (DayNight_Day){
DayNight_Night.activate();
}
else {
DayNight_Day.activate();
}
});
,Regards thank you for any help