(function () { var spawnPoint = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation()))); // constructor // constructor function TestFx() { var animationSettings = JSON.stringify({ fps: 30, frameIndex: 0, running: true, firstFrame: 0, lastFrame: 300, loop: true }); this.entity = Entities.addEntity({ type: "ParticleEffect", animationSettings: animationSettings, position: spawnPoint, dimensions: {x: 2, y: 2, z: 2}, emitVelocity: {x: 0.001, y: 0.0016, z: 0.0006}, emitRate: 1.5, particleRadius: 1.2, radiusStart: 1, radiusFinish: 1.4, velocitySpread: {x: 0.005, y: 0.0058, z: 0.003}, accelerationSpread: {x: 0.05, y: 0.035, z: 0.04}, emitAcceleration: {x: 0, y: 0.13, z: 0}, textures: "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-FIRE-2b.png", lifespan: 2.4, alphaStart: 0.65, alpha: 1, alphaFinish: 0, colorStart: {red: 255, green: 255, blue: 255}, color: {red: 255, green: 255, blue: 255}, colorFinish: {red: 190, green: 50, blue: 45}, visible: true, locked: false }); this.isPlaying = true; } TestFx.prototype.Destroy = function () { Entities.editEntity(this.entity, { locked: false }); Entities.deleteEntity(this.entity); } var objs = []; function Init() { objs.push(new TestFx()); } function ShutDown() { var i, len = objs.length; for (i = 0; i < len; i++) { objs[i].Destroy(); } objs = []; } Init(); Script.scriptEnding.connect(ShutDown); })();