How to get the final velocity of a rigidbody
Hi,
I have a rigidbody. I can call rb.velocity and get/set its value. But I want the velocity value that shows in the inspector (see attached img). How can I access it?
Thank you
Answer by DenisIsDenis · Mar 06 at 02:17 AM
GetComponent<Rigidbody>().velocity is equal to the velocity shown in the info section. And speed is the length of the velocity vector: GetComponent<Rigidbody>().velocity.magnitude
Ah I see. I was trying to access the value AFTER setting it, not before. I needed to wait one cycle before accessing it.
Thanks!
Your answer
Follow this Question
Related Questions
Why my gravity direction is rotating with transform.rotation? 1 Answer
How to apply a force at certain point of an object? 0 Answers
[Help] Player stops moving when hitting wall diagonally 0 Answers
What about physics happening far from the (floating) origin ? 0 Answers
RigidBody MovePosition lags behind another RigidBody 1 Answer