How can I add and obj value in a script?
I have a problem with a script, I want to change masks when you tap, I did one but it didn't work. It doesn't appear the button of add value.
This is the script:
// @input SceneObject[] obj
var count = 0;
script.obj[0].enabled = true;
for (var i = 1; i < script.obj.length; i++)
{
script.obj[i].enabled = false;
}
function onTapped(eventData)
{
count++
for (var i = 0; i < script.obj.length; i++)
{
if (count == i)
{
script.obj[i].enabled = true;
}
else
{
script.obj[i].enabled = false;
}
}
if (count == script.obj.length)
{
count = 0;
script.obj[0].enabled = true;
}
}
var event = script.createEvent("TapEvent");
event.bind(onTapped);
Is it has an error? or maybe is another script?
Hey, I tested your script above seems to be working fine maybe you didn't save the script press Crtl + S in the script panel, also yes the script has an error but it should still work exactly as it should
if you need an example project here it is I made it with your script simple, nothing to it
https://drive.google.com/file/d/1WhdpEo397j3UfbyTpQAzkWyFRYlj1ypT/view?usp=sharing
if you need any more help just reply to this. :)