…doesn’t say so in the documentation - is it measured in m\s?
No, it’s the same units as rigidbody.velocity (which can be m/s if you say it is). Also it’s a Vector3.
–Eric
Hey, Eric,
Sorry - don’t understand - it can be m/s? Do I have to change a setting in Unity to get this?
If not, how do I convert to m\s? I’d need to know the original units to do this conversion…?
Cheers,
SB
To get the meters per second I believe you need to multiply the relative velocity with delta time?
is that correct, then?
So I did a little experiment - a sphere with mass of 1 falling to a plane and reporting it’s speed using the Fixed Update function.
If I did the following:
rigidbody.velocity.magnitude/Time.deltaTime
I got the correct result.
After 1 second, speed = 9.8m\s
After 2 seconds, speed = 19.62m\s
After 3 seconds, speed = 29.43m\s
So that’s essentially it! The only issue with this is that the object appears to keep accelerating forever, which is a bit of a problem for realistic simulation. ![]()
If that’s how you’ve set things up, then yes. All units in Unity are arbitrary; it can be miles/s or cm/s if you want. The only thing that makes a unit a “meter” by default is having -9.81 in the y axis of the gravity settings. I don’t think things accelerate forever if they have any drag on them.
–Eric