A
A
Andrey Andryushchenko2016-01-05 06:59:26
Unity
Andrey Andryushchenko, 2016-01-05 06:59:26

unity. How to find out the speed while an object is moving?

In general, there is an object, and on it is a RigidBody, and so, I need to get the velocity vector of this object at the right time. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Dorofeev, 2016-01-05
@delphikettle

An object:

Rigidbody rb = GetComponent<Rigidbody>();
 Vector3 v3Velocity = rb.velocity;

Numerical value:
var speed = rigidbody.velocity.magnitude;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question