Hello, I attached a gif to my face using Legacy Face Sprite and I want my animation to play just for once, not in loop. I turned off Always Play button and applied the instructions using a scipt but it just doesn't work, since I turned off the Always Play, my gif never plays. Can you help me please?
These are the scripts that I've tried:
// -----JS CODE-----
// Plays an animated sprite
//@input Component.SpriteVisual spriteVisual
var loops = 1;
var offset = 0.0;var provider = script.spriteVisual.mainPass.baseTex.control;
// -----JS CODE----- var gifAnimation = script.getSceneObject().getFirstComponent("Component.SpriteVisual"); var loops = 1; var offset = 0.0; gifAnimation.getMaterial(0).getPass(0).baseTex.control.play(loops, offset);