local glitchsuppress = 1 -- For normal devices: 1 -- For overglitch supression: 0.5 (or a smaller number ig) local glitchfactor = Channel.keyframe().addKey(-100000, 0) local glitch = Scene.createSprite("glitch.png", "difference", "overlay") glitch.sort = 10000 glitch.layer = "Topmost" glitch.textureScaleX = 16 glitch.textureScaleY = 16 glitch.scaleX = Channel.random(math.random(0, 65485), 10000000, 14000000)*glitchfactor*glitch.textureScaleX*1.25*glitchsuppress glitch.scaleY = Channel.random(math.random(0, 65485), 10000000, 14000000)*glitchfactor*glitch.textureScaleY*1.25*glitchsuppress glitch.rotationZ = Channel.keyframe().setDefaultEasing("inconst") glitch.rotationX = Channel.keyframe() glitch.rotationY = Channel.keyframe() glitch.colorA = 0 glitch.translationX = Channel.keyframe().setDefaultEasing("inconst") addScenecontrol( 'glitch', {'duration', 'mode', "power"}, function (cmd) local timing = cmd.timing local duration = cmd.args[1] local mode = cmd.args[2] local power = cmd.args[3] glitchfactor.addKey(timing - 1, glitchfactor.valueAt(timing - 1)).addKey(timing + duration, power) if mode == "pixel" then glitch.translationX.addKey(timing, 5000) glitch.rotationZ.addKey(timing, 0) elseif mode == "wave" then glitch.translationX.addKey(timing, -5000) glitch.rotationZ.addKey(timing, 0) elseif mode == "split" then glitch.translationX.addKey(timing, 0) glitch.rotationZ.addKey(timing, 45) end end )