you need to look into coroutine. At the moment, when the while loop starts it performs the whole movement within the Start method, so you don't see the progression only the final result.
With a coroutine, you can leave the method at a point and get back there next frame. In between the object is rendered:
void Start(){
StartCoroutine(Move());
}
IEnumerator Move(){
float b = 0;
while (b < 1) {
transform.position = new Vector3 (b + 1, b + 2, 0);
b += .01;
yield return null;
}
}
↧