Hi, in my game i instantiate various textures onto the scene and animate them along the X-axis with mathf.Lerp.This works fine for the first set that instantiates but the other sets dont animate. Heres my code
//
#pragma strict
var xStartPosition : float = -1;
var xEndPosition : float = 0.5;
var speed : float = 1;
private var StartTime : float;
function Start () {
StartTime = Time.deltaTime;
}
function Update () {
transform.position.x =Mathf.Lerp(xStartPosition,xEndPosition,(Time.time-StartTime)*speed);
}
Any help would be appreciated