Constant force, not constant at all!!


I have attached a constant force component to a rigid body and then I use transform.constantForce.force = (transform.forward * 50);

But, by time the speed keeps increasing, so its not constant,not at all…
And another problem, it wont even update when I rotate the object, keeps going on the old axis.

Am I missing something, or what ? I am getting crazy here trying to make a cube move by force which should be like humanoid constant force.

It seems you are a bit confused about force and velocity. A constant force will linearly accelerate your object. If you want a constant velocity, just set the velocity of the rigid body once. If you set “drag” to 0 (which simulates air-resistance) the velocity will stay constant and moves the object at the same speed.

If I’m reading the documentation correctly - Unity - Manual: Constant Force component reference - it looks like constant force applies linear acceleration to an object. So imagine you’re in a car and you press the gas pedal all the way down. You’re not going to be go 100MPH immediately. It will take some time for the car to get up to that speed and, depending on your car, it might get there. But throughout the acceleration to 100, you’re not increasing the amount of force (ie. pushing the gas pedal down farther). You’re applying a constant force and your car is going faster and faster.

If you want a constant speed, try using Transform.Translate - Unity - Scripting API: Transform.Translate

Hope that helps!

ConstantForce will apply the force every frame until you change the force. Please check your code and ensure that you are only setting the constant force once, not calling it in a loop, for example.

If you only want the force to be applied while a key is held, say, then you should be looking at AddForce instead.