- Home /
Question by
Oleksandr Sokil · Mar 27, 2014 at 10:54 PM ·
rigidbodyvelocityspeechmagnitude
Calculating speed with rigidbody.velocity.magnitude
Okay, I know that you can calculate speed with rigidbody.velocity.magnitude;
, but how to do that? Can someone of you, guys, show me an example. Like this: var SpeedTXT: GUIText;
function Update(){
var rawSpeed = rigidbody.velocity.magnitude;
Time.timeScale = 1;
SpeedTXT.text = "Speed = " + rawSpeed;
}
Actually that was my script, and the problem is that it shows me only 0(even when my plane moves). So what should I do? Please help.
Comment
Are you adding forces to your rigidbody to move it, or are you just moving the transform?
Your answer
![](https://koobas.hobune.stream/wayback/20220613141342im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Adding player velocity to projectile not working 0 Answers
Why is this loop infinite? 1 Answer
increase float when another one decreases 1 Answer
Rigidbody magnitude 3 Answers
checking angular magnitude 1 Answer