Can't work what is wrong.
I have spent two days now going over this code and still I get rejected for errors when submitted.
All works fine on preview and when pushed to phone from Lens Studio.
// -----JS CODE-----
//@input Component.AudioComponent audio
script.audio.play(1);
//@input Component.SpriteVisual AliA
script.AliA.enabled = true;
//@input Asset.Texture movie
var animation = script.getSceneObject().getFirstComponent("Component.SpriteVisual AliA");
var loops = 1;
var offset = 0.0;
animation.getMaterial(0).getPass(0).baseTex.control.play(loops, offset);
var delayedEvent = script.createEvent("DelayedCallbackEvent");
delayedEvent.bind(function(eventData)
{
// script.AliA.getMaterial(0).mainPass.baseColor = new vec4(0, 0, 0, 0);
script.AliA.enabled = false;
script.audio.volume = 0.1;
});
delayedEvent.reset(6.7);
Hi James! For this line:
var animation = script.getSceneObject().getFirstComponent("Component.SpriteVisual AliA");
I dont know if it is a typo. For the component name, you need to remove the AliA after the SpriteVisual:
var animation = script.getSceneObject().getFirstComponent("Component.SpriteVisual");I was able to submit my test lens after this fix. Let me know if it still does not work for you!