- Home /
Particle System not working properly?
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
}
Have you checked the maximum amount of particles being allowed to be alive at the time? $$anonymous$$aybe it stops because it would exceed the value?
@ Hexagonius: Thank you for your reply. Yes I check the maximum amount of particles. It is set to sufficient particles.
Have you checked "prewarm" when you reate your particle effect? And if that doesn't work just make your particleEffect to an gameobject and do:
myparticle.SetActive(true); //myparticle is a gameobject with the particle system
@ Carlqwe: Thanks for replying. Okay I tried with the prewarm on, the basic principle works. BUT I wanted to achief an effect of fade in and fade out for more realism. So with the prewarm on there is "suddenly" a lot of snow on the screen. With the setactive option it is also working but it doesn't achief that kind of realism I'm after for. I just simply do not understand why other effects do work perfectly and with the snow I can't figure it out.
Answer by BonusB · Jul 06, 2020 at 02:01 PM
Hey I had the same problem, this should fix it: How to fix parricles system not woring
This is clearly a joke reply. How about you give constructive help instead of sending a rick roll?