1. Home
  2. Docs
  3. PopcornFX v2.7
  4. Scripting reference
  5. effect

effect

The effect namespace contains all effect-related functions and variables.

 

Return typeDescription
booleffect.isRunning()
Returns true if the parent effect instance is still running, false if it has stopped.
This can be used to detect when the effect is stopped, and kill infinite particles, or gracefully fade them out.
booleffect.isRenderingEnabled() [v2.7.0]
Returns true if the parent effect instance has rendering enabled, false if it was explicitly hidden.
This can be used to detect when the parent effect instance has been explicitly hidden by the game engine. It is automatically bound to each renderer’s Enabled pin.
Note that this does not represent when an effect is culled by the view frustum or LOD system, it is a separate “show/hide” mechanism.
booleffect.isTeleporting() [v2.7.0]
Returns true if the parent effect instance has been teleported this frame.
This can be used to shutdown distance-based trail emission or other things sensitive to very large distances travelled in a single frame.

 

Time

Return typeDescription
floateffect.age()
Returns the age of the parent effect instance, in seconds.
floateffect.dt() [v2.7.0]
Simulation timestep as experienced by the parent effect instance.
Equals to scene.dt, unless the effect instance has a time-scale factor (time-dilation) different from 1.0
effect.dt() = scene.dt * effect.timeScale();
floateffect.timeScale() [v2.7.0]
Time-scale factor applied to the parent effect instance. By default, equal to 1.0.

 

Transforms

Return typeDescription
float3effect.position()
Returns the position of the parent effect instance, in worldspace.
float3effect.velocity()
Returns the velocity of the parent effect instance, in worldspace.
orientationeffect.orientation()
Returns the orientation of the parent effect instance, in worldspace.
float3effect.scale()
Returns the scale of the parent effect instance, in worldspace.
float3effect.axisSide()
Returns the side axis of the parent effect instance (left / right), in worldspace.
float3effect.axisVertical()
Returns the vertical axis of the parent effect instance (down / up), in worldspace.
float3effect.axisDepth()
Returns the depth axis of the parent effect instance (backward / forward), in worldspace.
float3effect.axisLeft()
Returns the left axis direction of the parent effect instance, in worldspace.
float3effect.axisRight()
Returns the right axis direction of the parent effect instance, in worldspace.
float3effect.axisDown()
Returns the down axis direction of the parent effect instance, in worldspace.
float3effect.axisUp()
Returns the up axis direction of the parent effect instance, in worldspace.
float3effect.axisBackward()
Returns the backward axis direction of the parent effect instance, in worldspace.
float3effect.axisForward()
Returns the forward axis direction of the parent effect instance, in worldspace.

 

LOD

Return typeDescription
floateffect.lodBias()
LOD bias of the current effect instance.
This value is in the [-1, 1] range.
Was this article helpful to you? Yes No

How can we help?