Skip to content

Random Seed

The asset shader has a random seed property (_TimingSeed). This property will give some variation to the material. Different seed values will cause different scrolling, rotations and distortions on the shader, therefore causing a visual distinction between the same materials with different seeds. This can help avoid repetition in between particles using the same Material or meshes using the same Material.

Four flames sharing one material: without a seed they move in lockstep, with All1VfxRandomTimeSeed on each they all differ

For Particle Systems you can add the Particle System Helper Component (see it’s section of the documentation) and press the Custom Data Auto Setup button. The 0 to 100 X axis property of the Custom Data section of the Particle System is the random timing seed:

The Particle System Custom Data with Custom1 X set between 0 and 100, the random timing seed from Custom Data Auto Setup

For Meshes you can just add the All1VfxRandomTimeSeed script to the GameObject and the Random seed will be assigned on start, between its Min Seed Value and Max Seed Value. Note that the shader is prepared to GPU instance this property (the Lit shader isn’t), so you could enable GPU Instancing in the Material Inspector Advanced Configuration and the instancing won’t break even if you use this script on all mesh instances.