I’m having difficulties trying figuring this one out. I have a script that makes a particle system play or stop playing, depending of some variables. The EXACT same script I have already set up for making a rain particle. This one is for a snow particle and is identical with the rain script, except the variable is_raining is switched for is_snowing. Howcome the rain script is working perfect and the snow script is not working? It just emits for a second and then stops emitting particles. When I test the particle system through a GetKey command, it IS working perfect. Anyone any idea?
This is the javascript for the snow particle system:
var statscript : Stats;
function Start ()
{
statscript = gameObject.Find(“Player”).GetComponent(Stats);
}
function Update ()
{
if(statscript.is_snowing == true)
{
particleSystem.Play();
}
if(statscript.is_snowing == false)
{
particleSystem.Stop();
}
}
And this is the script for indiciting if there is snow or rain.
if (fallout == true) // if fallout then …
{
if (temperature_degrees >= 1)
{
is_raining = true; // this plays the rain particle in RainScript
is_snowing = false; // this stops the snow particle in SnowScript
}
else if (temperature_degrees <= 0)
{
is_raining = false; // this stops the rain particle in RainScript
is_snowing = true; // this p1ays the snow particle in SnowScript
}
}
else if (fallout == false)
{
is_raining = false; // this stops the rain particle in RainScript
is_snowing = false; // this stops the snow particle in SnowScript
}