Functions¶
The system lets you call custom functions for your needs, whether it be when the particle spawns, is destroyed, reaches half it's lifetime, every frame, or when the particle collides with something paired with EnableCollision
OnSpawn¶
- Description: This function is called when a particle is first created or spawned.
- Default:
nil
- Example:
HalfLife¶
- Description: This function is called when a particle reaches half of its lifetime. Not affiliated with Half Life
- Default:
nil
- Example:
OnDeath¶
- Description: This function is called when a particle is about to be destroyed or removed.
- Default:
nil
- Example:
ConstantFunction¶
- Description: This function is called every frame prior to the frame being rendered.
- Default:
nil
- Example:
OnCollision¶
- Description: Lets you to use a function that is called whenever a particle collides with an object. This function is paired with the velocity that the particle has when the function is called.
- Default:
nil
- Example:
OnBeat¶
- Description: A function that is played every beat or hit that the system detects, using
BeatDetectionThreshold
as it's source. - Default:
0.15
- Example:
These functions provide hooks into different stages of a particle's lifecycle, giving you the flexibility to create sophisticated effects. By defining custom functions for spawning, mid-life, death, and collision, you can control exactly how your particles behave and interact with the environment.