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

by flatterino   Last Updated June 11, 2019 19:13 PM

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.

Tags : unity physics

Related Questions

Updated June 04, 2015 23:05 PM

Updated October 13, 2016 09:05 AM

Updated July 30, 2017 16:13 PM

Updated December 06, 2016 08:05 AM

Updated September 01, 2017 18:13 PM