I'm trying to accomplish a delay effect by grabbing a texture each frame and pushing it into an array. Once the array reaches 30 in length, it starts removing the first index in the array, and then is constantly updating each frame! It works exactly as I want, but the problem when I test the lens is that I see the RAM constantly increasing until my Snapchat app eventually quits. Is there a way to solve the RAM issue? Thanks!
Here's the code I used.
// -----JS CODE-----
// @input Asset.Texture texture
// @input Component.Image img
var textureLoop = ;
var event = script.createEvent("UpdateEvent");
var tex = script.texture.copyFrame();
if (textureLoop.length > 30)
script.img.mainPass.baseTex = textureLoop;
Please sign in to leave a comment.