- Home /
Question by
oliver-jones · Nov 11, 2016 at 01:23 PM ·
colorparticle systemgradient
Particle System - Get 'Start Color' as Gradient
Hello,
Tried searching the web for this with no luck :/
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?
Comment
Answer by blackant · Mar 27, 2018 at 04:54 PM
try this it will work for gradient.
public Gradient InnerColor;
void Start () {
var partSys = GetComponent<ParticleSystem>();
var main = partSys.main;
main.startColor = InnerColor;
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612100459im_/https://answers.unity.com/themes/thub/images/avi.jpg)