# How to create particle system by script

I have created a gameObject called "Sphere". After 5 secs the gameobject starts rotating. Along with the rotation I need to emit partical from the object. How can I do this?

You need to add your particle system to your gameObject. then you can activate it by something like this:

    // this is in the initial declaration
particleEmitter pe;

// this is in the Start() function
pe = gameObject.GetComponent<ParticleSystem>().particleEmitter;

// this go's inside your counter function and needs to get called
// when you activate to rotation
pe.emit = true;


you need to turn of the emission component of the particle system in the editor