You can duplicate the animated texture in Studio and assign each to your object. If you group all your objects under one parent, you can do a for-loop to change the start frame of each texture as follows:
for (var i = 0; i < script.getSceneObject().getChildrenCount(); i++){
var animatedTextureControl = script.getSceneObject().getChild(i).getFirstComponent("Component.Image").mainPass.baseTex.control;
var randomFrame = Math.floor(animatedTextureControl.getFramesCount() * Math.random());
animatedTextureControl.playFromFrame(randomFrame, -1);
}
Note, because Lens Studio optimizes the same resources into a single resource, it won't incur additional cost to your Lens size because of the duplicated animated texture.
Lens Studio Support
Featured Articles
- How should I report bugs and crashes?
- Can I print my Snapcode before my Lens is complete?
- Can I keep my Lenses private?
- How can I combine multiple templates?
- Can I add a face mask to a face inset?
- How do I play multiple animations?
- Can I animate objects via code within Lens Studio?
- What should I do if I'm missing a panel or section of Lens Studio?
- Why does my PNG animation sequence immediately deteriorate in quality once I upload it as an animation texture?
- Why does my imported material show as a pink and black checkerboard on my 3D object?