I have set particle system of duration 5 seconds.
But, I wouldn't like particle system to repete but to be frozen in fourth second forever.
How to do that?
I have set particle system of duration 5 seconds.
But, I wouldn't like particle system to repete but to be frozen in fourth second forever.
How to do that?
You can do it with Pause()
function of ParticleSystem
class. Here is an example;
using UnityEngine;
using System.Collections;
public class ParticleController : MonoBehaviour {
public ParticleSystem particles;
// Update is called once per frame
void Update () {
//After 4 seconds, pause particles
if(Time.timeSinceLevelLoad > 4f) {
particles.Pause();
}
}
}
Check here for further information
particles = gameObject.GetComponent<ParticleSystem>()
\$\endgroup\$
public List<ParticleSystem> particleSystems
in ParticleController
class. That will allow you to use inspector to drag ParticleSystem
objects in to the ParticleController
. When you enter a positive number other than 0 in the size
attribute of the list, the slots will open for you to drag the objects.
\$\endgroup\$
Commented
May 25, 2017 at 20:54