# How to plot a series of particles at given points

I am currently using the following script to show a prefab sphere. I would however like to change it to a one-shot particle representation. How would I go about drawing particles rather than my current sphere. I have tried following the script guidance but am getting nowhere.

var spherePrefab: GameObject;

var x: float;
var y: float;
var z: float;
var dx: float;
var dy: float;
var dz: float;

function Start () {

number_of_particles = 2000;

x = 1;
y = 1;
z = 1;

for (i = 0; i < number_of_particles; i++) {

dx = Mathf.Sin (1.4 * y) - z * Mathf.Cos (2.3 * x);
dy = z * Mathf.Sin (0.77 * x) - Mathf.Cos (1.58 * y);
dz = Mathf.Sin (0.77 * y) - x * Mathf.Cos (1.4 * z);

x = dx;
y = dy;
z = dz;

thisPlot = Vector3(x * 120,  y * 120, z * 120);

Instantiate(spherePrefab, thisPlot, Quaternion.identity);

}
}

If you want the particles in exactly the positions specified by your script, just a few small changes should work:

var x: float;
var y: float;
var z: float;
var dx: float;
var dy: float;
var dz: float;

function Start () {

number_of_particles = 2000;

x = 1;
y = 1;
z = 1;

// reset and emit the desired number of particles:
particleEmitter.ClearParticles();
particleEmitter.Emit(number_of_particles);

// get a copy of the particle list
var particles = particleEmitter.particles;

// modify the particle positions
for (i = 0; i < number_of_particles; i++) {

dx = Mathf.Sin (1.4 * y) - z * Mathf.Cos (2.3 * x);
dy = z * Mathf.Sin (0.77 * x) - Mathf.Cos (1.58 * y);
dz = Mathf.Sin (0.77 * y) - x * Mathf.Cos (1.4 * z);

x = dx;
y = dy;
z = dz;

thisPlot = Vector3(x * 120,  y * 120, z * 120);

particles*.position = thisPlot;*
*}*
*// copy them back to the particle system*
*particleEmitter.particles = particles;*
*}*
*```*
*<p>And if you want those particles to remain in place indefinitely, then you can just remove the "Particle Animator" component from your particle system gameobject.</p>*