I want to make a physics simulator for school, and I want a rigidbody that makes a free fall by gravity force. (9,81 N).
When I apply to a cube the rigidbody, and set the mass to 4kg, it should take 0,5 seconds normaly to fall from a heigh of 10m. However, it needs 1+ seconds to fall, with every mass I put.(It’s the same with 1kg and 1000000000 kg)
Why is this happening?
In fact no matter how heavy an object is, it takes equal amount of time for it to fall as any other object. Gravity in this perspective is not a “force” but an acceleration. It’s value is not measured in Newton, but m/s^2, aka. acceleration.
While I don’t know exactly what units the underlying PhysX system works with, you can query (and set) the value for gravity with
Physics.gravity which is a
Vector3, and also visually in Edit / Project Settings / Physics.
You can also set a rigidbody’s Drag property, which according to the docs corresponds to air resistance. 0 is no air resistance, and if it’s infinity, the object stops moving.
I guess your best shot is to come up with a [gravity value, object mass, distance scale] combination that makes sense for you for a unit-weight object, and build your simulation based on that agreeable combination of values. (for example find a setting where your object falls in 0.5 seconds the desired distance (which may not be exactly 10 unity-units), and use that as the scale for everything else in your scene).
You can use alucardj’s neat script for the timing.