Particle shaders - how to randomize scale of each particle in 3D?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Macryc

Hi all, I’m using a 3d particle shader to make grass. The particles are emitted once a second and the emitter is attached to the player. In the shader I’ve set the particles to render only within a certain distance from the emitter and I position each particle in the code. I apply a random rotation to each, and the rotation remains as is upon each emission.
I have a problem though with scaling. I can apply a random scale to each particle using TRANSFORM and random seed so each particle has a slightly different scale. But the problem is, 1 sec after they are emitted they are emitted again (lifecycle is set to 1 s) and this time, while the rotation remains as before, scaling does not.
I can’t lock the lifecycle because then the parts won’t re-emit as the player moves.
How do I get the parts to each be randomly scaled but also ‘lock’ this initial random scaling?

:bust_in_silhouette: Reply From: Inces

Use custom seed. Don’t generate random number, just use some stable calculation revolving around INSTANCE_ID, that will return always the same number.