I want to change text on tap.
-
Hey here is a script to cycle trough images.
Let me know if this works :D
// -----JS CODE-----
// @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);Comment actions -
thanks! can i add this script to an image touch button? SirQu3ntin
Comment actions -
SirQu3ntin I MADE IT WORK ON TEXTS, thanks!!!
Comment actions -
sammyboy800 great! And and yes it should work with an touch button. Just add an "touch target". :D
Cheers,
SirQu3ntin
Comment actions
Please sign in to leave a comment.
Have a comment?