# With gravity enabled, how do you move a RigidBody forwards at a specific speed?

I have a perfectly smooth cube on top of a perfectly smooth plane. I am applying a forward-force of 1 unit per second, using rigidBody.AddForce(new Vector3(0, 0, 1), ForceMode.VelocityChange). I apply this force every FixedFrame(), taking into account Time.fixedDeltaTime, of course.

When the "Use Gravity" checkbox on the RigidBody is not checked, the object behaves as expected; after exactly 3 seconds, it has a speed of exactly 3 units per second.

However, when I enable the "Use Gravity" checkbox, the object barely moves. Both the object and the surface are using Physic Materials with zero friction, and the moving object's RigidBody has zero drag and zero angular drag.

Why does this happen? And more importantly, how would I apply a force to this object so that it moves forward at, say, exactly 3 units per second, with gravity enabled?

Thank you.

Are you using a "frictionless" physic material or just leaving it unassigned altogether? I've learnt that an unassigned physic material still has some kind of friction resistance, along with physic materials having a diference in friction with the dynamic friction and static friction attributes.

Try creating a true frictionless physic material with these set to 0 and you should have behavior similar to an ice cube sliding along.

• That's the thing: I am using a frictionless material, manually made. – flatterino Jun 13 '19 at 17:32

You can multiply your vector3 with MoveSpeed variable. In my How to move Character according to Camera's look direction? question i've posted an answer. I'll link that so you can examine it.

1. That's how i did:

targetPosition = (camF * vec.y + camR * vec.x) * MoveSpeed;

Vector2 targetVelocity = (targetPosition - transform.position)/Time.deltaTime;