I want to animate a shape to a certain pos.

I am a new and I don’t understand how to move a shape at regular intervals.

For instacne, a cube moves to (10, 0, 0) from (0, 0, 0) per 1 pixel a sec.

So, I did like this.

Update()
{
fTime = Time.DeltaTime;
if(fTime < 1 cube.x < 10)
cube.x++;
fTime = 0;
}

However, the speed is totally fast, and somethimes it teleports … I mean not like animating.

Anyone help me. Thanks :slight_smile:

var speed: float = 2;

function Update()
{
  if(cube.x < 10)
    cube.x+= Time.deltaTime * speed;
}

Sounds like you need to do the tutorials. Follow the support link up top and do the lerpz tutorial

Time.DeltaTime will return some floating point…
Once fTime is equal 1, it should be 1 sec.
So you should change it to :

fTime += Time.DeltaTime;
if(fTime > 1 cube.x < 10)
cube.x++;
fTime = 0;
}

Thanks. :slight_smile:
I need to do tutorials first.