Everything is choppy... How can I make object movement more fluid?

Hello,

I’m having problems with making objects move fluidly through my game world.

I’ve toned it down to an extremely basic situation:

Setup:

5 x planes placed one after another to make a long “field”; All static

1 x cube (basic 3d shape cube)

1 x camera - child of cube

No lights, No shadows cast, no shadows received.

The following extremely simple script is attached to the cube:

void Update()
{ 
     transform.position = Vector3.Lerp(transform.position, transform.position + transform.forward, Time.deltaTime * 5f);
}

This causes the cube to move “choppily” through the scene.

Can anyone suggest a way to make this cube move fluidly through the scene?

NOTE: the choppiness is palpable in the editor, and on my target platform (android, galaxy s4 device, 4.4.4) // using unity 5 free

Thank you.

UPDATE:

It seems that the problem is limited to Android platform builds. I tried switching to WebGL, which resulted in full fluidity in both the editor and in Chrome…

I had made a far more complex scene in 4.6 (for a different project), which did not have this choppy movement problem (on Android)… I guess I’ll investigate platform specific issues and fixes…

That’s a very peculiar movement code. If you just want to move forward at a rate of 5 units per second, try:

transform.position += transform.forward * Time.deltaTime * 5f;

Try implementing some dampening to your movement code. I wont write the code for you but have a link to the documentation ^^

Replace update with LateUpdate and see if it works.

"I don’t understand why my original code, or tanoshimi’s, doesn’t produce perfectly fluid movement… Mathematically, it should "
You are right , because its not the choppiness in the cube its the choppiness in the camera’s perspective.

Making camera a child of the GO ( cube in your case ) is not really a good practice.
Trying changing to LateUpdate , if that dosent work well then you should preferably detach the camera and script for following the movement rather.