Making a particle become nothing

  • camtech56
    23rd May 2015 Member 0 Permalink

    I'm trying to make an element that "absorbs" particles around it. How do you make a particle become empty space?

  • jacob1
    24th May 2015 Developer 0 Permalink
    @camtech56 (View Post)
    Are you trying to kill the particle? You can use the sim.partKill function.

    Here are some example scripts that loop through sim.neighbors to find other particles.
    http://starcatcher.us/scripts/#60
    http://starcatcher.us/scripts/#19

    Maybe better example:
    for r in sim.neighbors(x,y,1,1) do
    local rtype = sim.partProperty(r, sim.FIELD_TYPE)
    if rtype ~= [yourelementid] then
    sim.partKill(r)
    end
    end
  • Ahpiox
    4th Dec 2017 Member 0 Permalink

    @jacob1 (View Post)

     What about making it slower, because i trying to make gastric acid element, and real gast. acid cant destroy something so fast

  • Sanpypr0
    6th Dec 2017 Member 0 Permalink

    @Ahpiox (View Post)

     you could have it set the particle's life value, and when it decrements to 0 it 1. loops back to the value you set, and 2. deletes a random particle around it, that way it doesn't do it super fast

  • Ahpiox
    9th Dec 2017 Member 0 Permalink

    @Sanpypr0 (View Post)

     Thanks, but i found ahother way: i just randomized this process. It is if variable value (which is math.random) equals to 4, then it melt something.

    Sorry for my good english, because this lang is not my native