Hey guys, I have a basic box moving up and down and I can’t figure out how I will get it to work. Am trying on that for days now. It rotates and it moves up but I just want it to move up x-units and then move down in an endless loop. A gravitating platform like in old jump and runs etc.
Thanks in advance!
The code I have so far is here:
var rotateSpeed : float = 10;
var moveUpSpeed : float = 5;
function Update()
{
transform.Rotate(0, rotateSpeed * Time.deltaTime, 0);
transform.Translate(0, moveUpSpeed * Time.deltaTime * 0.2, 0);
}