How to limit particles position?

I made a “fountain” VentGroup. But a practicle should disappear if it’s y > 300.

I try this:

onUpdate = function(ob)

  if ob.y > 300 then

    ob.isVisible = false

  end

end,

but I’m afraid about a performance…

How should I do it?

Each particle, when it’s created, is given a secure deletion function called “_kill”.

[lua]

onUpdate = function(ob)

  if ob.y > 300 then

    ob._kill()

  end

end

[/lua]

The _kill function deletes the particle and removes all references to it.

  • C

Each particle, when it’s created, is given a secure deletion function called “_kill”.

[lua]

onUpdate = function(ob)

  if ob.y > 300 then

    ob._kill()

  end

end

[/lua]

The _kill function deletes the particle and removes all references to it.

  • C