GetParticleAttribute

The GetParticleAttribute Node

This Node can be used to retrieve a single attribute from the particle that the system is currently spawning. As such the node cannot be used with an Emitter block, as the emitter has no particle data and is simply for setting the spawn point and spawning characteristics of the particles. Using this node you can choose to get the current value for the attribute or get the initial value for the attribute. This choice is made by selecting the ParticleLocationType from the Inspector window:

The options here are:

  • Current: This will get the current attribute value, which will be updated every frame
  • Source: This will get the attribute value at the time the particle was initialised (as set in the Init block) as a static value

Using Source is recommended when you have complex calculations in the initialisation to generate a value and wish to use the same value in the particle update (thus avoiding performing unnecessary complex calculations every frame).

 

IMPORTANT: It is possible to create an "infinite loop" that will crash the simulation using this node. This happens when you get an attribute, then modify it and try to apply it to itself. For example, if you get the Size attribute, then apply a Multiply to it, then supply the result to the Size attribute of the Update node, it will generate an infinite loop.

 

 

Node Output

This node has the following output:

 

  • AttributeType
    The attribute type is set from the Inspector window:
    The GetParticleAttribute Options in The Inspector Window
    The following attribute types are available:

     

    String Type Description
    Age Float Returns a value that goes from 0 to [particle lifetime].
    AgeOverLifeTime Float Returns a value that is between 0 and 1, representing the [age] normalised.
    Lifetime Float Returns a value representing the total [particle lifetime].
    Position Vec3 Returns a vector of the particle position.
    Rotation Vec3 Returns a vector of angles (in degrees) of the particle rotation along the x axis, y axis, and z axis..
    Velocity Vec3 Returns a non-normalised vector of the direction for the particle (to be applied after the update pass).
    Size Float Returns a value that represents the size (radius) of the particle.
    Scale Vec3 Returns a vector that represents the X/Y/Z scale for the particle.
    TextureIndex Float Returns the current texture index value for the particle. Note that this value is only relevant when the Output block has the UVMode set to "Atlas". For more information see the Texture Index section of the Update block.
    id Float Returns a value that represents the unique ID of the particle.
    Colour Vec4 Returns a vector of integer values (from0 to 255 each) corresponding to the RGBA values for the particle.
    VelocityRotationAxis Vec3 Returns a vector representing the particle axis in the coordinate space of the effect (world or local depending on the <EmitInLocalSpace> parameter on the emitter block).
    VelocityRotationRate Float Returns a float which is the velocity rotation rate in degrees per second.