Emitting Rain Particles
- Last UpdatedJan 24, 2023
- 1 minute read
Rain particles are randomly emitted around the emitter position.
Spawning behavior
After a particle spawns, it operates in world coordinates. It does not follow the emitter around.
A particle dies when it either:
-
Collides with the HeightMap
-
Drops below a predefined Y value (yDrain)
On the next frame, the dead particle attempts to respawn. If the new respawn position is invalid, the particle dies again and is not rendered. This continues until the particle respawns in a valid position.
Emission Volume problem
Respawning behavior can cause problems when the emission volume is halfway between a valid position, such as outside, and an invalid position, such as inside a building.
In this case, half the particles are invalid and the code renders half the particles.
Increase the number of particles and the emission volume to resolve this issue.
Emission diagram
In the following diagram, black labels are node parameters. Blue labels are code calculations.
