- Home /
Emit 1 particle per second
Hey,
In my scene I have a particle system that should only emit particles when the hand is raised. In the editor i've set the emission rate to 1 per second and play on awake turned off.
When I try to enable emission either through leftWeapon.enableEmission = true;
or leftWeapon.Play();
nothing happens.
When I do leftWeapon.Emit(1);
it spawns 1 particle every frame. So what I'm wondering is..How do I emit 1 particle each second either through getting leftWeapon.enableEmission = true;
to work or only calling leftWeapon.Play();
once per second
thanks :)
Answer by Hrungdak · Mar 30, 2015 at 08:18 AM
A particle system with one particle per second:
Select particle system in your Hierarchy
In Inspector: Set duration to 1
set Looping to true
In "Emission": set Rate to 1
This should provide you with one particle per second.
To start the emission, go like this:
private ParticleSystem m_Particles;
void Start()
{
m_Particles = GetComponentInChildren<ParticleSystem>();
}
void Update()
{
if (Time.realtimeSinceStartup > 1 && Time.realtimeSinceStartup < 10)
{
if (!m_Particles.isPlaying)
{
m_Particles.Play();
}
}
else
{
m_Particles.Stop();
}
}
Your answer
Follow this Question
Related Questions
Make Start Color setting in particle system control _EmissionColor 1 Answer
How change Emission color of material together with particles system"Color over lifetime" ? 0 Answers
Can't get particles to enable/disable with button press 1 Answer
Particle System not working properly on Android 0 Answers
Particle emission : Give each particle a specific direction 1 Answer