I have 2 scripts, in one of which I have 2 color variables:
public Color color;
public Color sparkColor;
In the other script, I have a function where I want to change the startcolor of a particle system to the given colors:
void ChangeColor()
{
particleSystem.GetComponent<ParticleSystem>().startcolor = otherScript.color;
particleSystem2.GetComponent<ParticleSystem>().startcolor = otherScript.sparkColor;
}
The problem is, when I do this the particle system shuts off.
I tried changing the function to one of the preset colors (startcolor = Color.red) and this worked. But how do I make it so I can change it to a color I choose?