Particle

Main Module

MainModule is the primary module of the ParticleGeneratorModule, containing the most basic particle generation parameters. Most of these properties are used to control the initial state of newly created particles.

avatar

Properties

You can debug each property in the provided example to better understand and control the particle main module, thereby achieving various complex and beautiful visual effects.

PropertyDescription
durationDuration. Determines how long the particle generator runs, in seconds. A longer duration means the particle system will generate more particles, creating a continuous effect.
isLoopWhether to loop. If set to true, the particle generator will automatically restart after the duration ends, forming a continuous effect like smoke or flowing water.
startDelayStart delay time. Determines how long the particle generator waits before emitting particles after starting. Useful for achieving effects like fireworks that require a time delay.
startLifetimeInitial lifetime. Determines how long each particle can survive before disappearing. A longer lifetime means particles will stay on the screen longer.
startSpeedInitial speed when particles are first generated. Determines the speed at which particles are emitted. A higher initial speed will cause particles to spread rapidly, like an explosion effect; a lower speed will make particles float slowly, like smoke.
startSize3DWhether to specify particle size separately for each axis. Allows setting different sizes for the particle's x, y, and z axes, creating anisotropic particle effects, such as elongated flames.
startSizeInitial size when the particle generator first generates particles. Controls the size of each particle. A larger initial size is suitable for simulating large clouds of smoke or flames, while a smaller size is suitable for delicate dust or splashes.
startSizeXInitial size along the x-axis when the particle generator first generates particles.
startSizeYInitial size along the y-axis when the particle generator first generates particles.
startSizeZInitial size along the z-axis when the particle generator first generates particles.
startRotation3DWhether to enable 3D particle rotation. Allows particles to rotate in 3D space, increasing their sense of depth and complexity, such as falling leaves in three-dimensional space.
startRotationInitial rotation when the particle generator first generates particles. Sets the rotation angle at particle emission, suitable for effects where particles need to move in a specific direction, such as directional flames.
startRotationXInitial rotation along the x-axis at particle emission.
startRotationYInitial rotation along the y-axis at particle emission.
startRotationZInitial rotation along the z-axis at particle emission.
flipRotationFlip rotation. Ranges from 0 to 1, causing some particles to rotate in the opposite direction, increasing the randomness and naturalness of the particle system, suitable for simulating complex motion trajectories.
startColorInitial color. Determines the color of particles, which can be used to simulate effects of different materials, such as the red-orange color of flames or the gray-white color of smoke.
gravityModifierGravity modifier. Adjusts the extent to which particles are affected by gravity, making them appear more realistic, such as falling raindrops or rising smoke.
simulationSpaceChooses the space in which particles are simulated. Determines whether particles move relative to the world or relative to the generator itself. World space is suitable for stationary effects like smoke; local space is suitable for effects that move with the object, such as flame trails.
simulationSpeedSimulation speed. Can globally speed up or slow down the movement speed of particles, suitable for slow motion or accelerated effects.
scalingModeScaling mode. Determines how the particle generator handles transformations such as position, rotation, and scaling when emitting particles. Using scalingMode ensures that the transformation relationship between the particle generator and the particles meets expectations.
playOnEnabledIf set to true, the particle generator will automatically start playing on launch. Enabling this option ensures that the particle system starts emitting particles as soon as it is activated, suitable for scenarios where immediate effects are needed.
maxParticlesMaximum particles. Limits the maximum number of particles in the particle system to prevent performance issues. A larger value is suitable for effects that require a large number of particles, such as dense smoke.

Explanation of scalingMode

The scalingMode has the following options:

  • Local: Particles inherit the local transformation of the particle generator, meaning the particle transformation occurs in the generator's local coordinate system.
  • World: Particles inherit the global transformation of the particle generator, meaning the particle transformation occurs in the world coordinate system.
  • Hierarchy: Particles inherit transformations from the entire transformation hierarchy, meaning particles consider transformations of the generator's parent and higher-level transformations.

Was this page helpful?