particles.setGravity

Section: Particles

What it does

particles.setGravity sets Gravity on a particles object. It takes id, x, y and z.

Signature

particles.setGravity(id, x, y, z)

Arguments

  • id
  • x
  • y
  • z

Example · generated

function start() {  particles.create('main', 10);  particles.setGravity('main', 0, 2, 0);}

particles.create is there to give the call something to act on; particles.setGravity is the line that matters. The code sits in start(), which the engine calls once, when the entity spawns.

14 members in particles