# Draw point with time function

I try to write a script to draw cloud-point. The script must draw a single point every second from an array (or or a time that I decide). I try to use Time (or delta.Time) function (I search inside forum without result) without result. I don’t understand it’work…
This is the script:

``````var dotMaterial : Material;
var PointsList : Array;
var Points : Array;
var PointsArray : Vector3[];
var dotSize = 1.0;
var dotsnumber = 1;
var dotstime = 1;

private var oldPosition : Vector3;
private var oldRotation : Quaternion;
private var cam : Transform;
private var dots : VectorPoints;

PointsList = [];

function Start() {
cam = Camera.main.transform;
oldPosition = cam.position;
oldRotation = cam.rotation;

Points = new Array();
for (i = 0; i < PointsList.length / 3; i++){
}

PointsArray = Points.ToBuiltin(Vector3);
dots = new VectorPoints("Dots", PointsArray, null, dotMaterial, dotSize);
dots.maxDrawIndex = dotsnumber; //this value say how many point of array drawing
Vector.DrawPoints(dots);
}

function Update()  { // every second script must be draw one more point
dotstime = Time.deltaTime*1;
dotsnumber = dotsnumber + dotstime;
}

function LateUpdate () {
if (cam.position != oldPosition || cam.rotation != oldRotation) {
oldPosition = cam.position;
oldRotation = cam.rotation;
dots.maxDrawIndex = dotsnumber;
Vector.DrawPoints(dots);
}
}
``````

“dotstime” is an int, so assigning Time.deltaTime to it will always result in 0. You’re better off just using InvokeRepeating anyway.

``````function Start () {
InvokeRepeating ("IncreaseDotsnumber", 1.0, 1.0);
}

function IncreaseDotsnumber () {
dotsnumber++;
}
``````