Anybody knows how I could slow down a loop? This goes way too fast. I tried with yeild but it didn’t work.
Script error: Update() can not be a coroutine.
Thanks
Robert
for (var loopA = 0;loopA < 90;loopA++) {
MyCube.transform.eulerAngles.y = MyCube.transform.eulerAngles.y -1;
}
write a separate function that contains your for loop and then call that function from Update(). Update cannot be a coroutine (i.e. no yields).
Update is called once every frame. If you want to rotate at a certain rate then I suggest using Time.deltaTime to make your calculation frame rate independent.