Particle System - Get 'Start Color' as Gradient

Hello,

Tried searching the web for this with no luck :confused:

I want to be able to cache the Start Color of my particle effect. This would be fine if my Start Color was a solid colour. But it’s a Gradient instead.

When I try and Get() the colour - it returns only as a Color, and not a GradientColorKey. And vice-verser, when I want to Set() the colour (gradient) - I can only set the Color.

Is there any way to access this?

try this it will work for gradient.

public Gradient InnerColor;
   void Start () {
    		var partSys = GetComponent<ParticleSystem>();
    		var main = partSys.main;
    		main.startColor = InnerColor;	
    		
    	}