- Home /
Rigidbody magnitude
I've currently got a script that writes rigidbody.velocity.magnitude of an object to a GUI Text. But the speed it prints seems Very unreallistic, like my standard speed ( a constant relative force of 600) comes out as 20 in speed. What do i do to make the speed how it should be?
Answer by Eric5h5 · Apr 22, 2010 at 09:09 PM
If rigidbody.velocity.magnitude is giving you a result of 20, then that's what it is, you don't do anything. Force isn't speed, it's just force...e.g., using a force of 600 with an object that has a mass of 1 will give you completely different results compared to an object that has a mass of 1000.
Answer by Molix · Apr 22, 2010 at 09:02 PM
Hard to know what "it should be", but presumably the velocity is in meters/second, so it may seem less than expected, e.g. 20 m/s = 72 kph = 44 mph.
Actually, the velocity is in meters per frame. For framerate independent motion (meters/second), multiply your force by Time.deltaTime.
No, it's not. Velocity (and its magnitude) is in units per second.
Oh, ok. I guess you learn something new every day. I revoted because I was wrong.
Answer by e-bonneville · Apr 22, 2010 at 08:53 PM
Well, if your results are constantly 1/30
of the force you want to see, you could multiply your result by 30
before printing it. If it's constantly changing, then I can't help you.
Your answer
Follow this Question
Related Questions
Rigidbody speed / Velocity issue 0 Answers
Rigidbody movement issues 1 Answer
Velocity powered rigidbody on a moving platform without parenting. 3 Answers
leftover rb.velocity.z that causes magnitude to spike randomly 0 Answers
How Do I Increase the ForwardForce of the player over time? using rigid body 2 Answers