unity get velocity of gameobject 1

unity get velocity of gameobject

Rigidbody rb = GetComponent();
rb.velocity; // Velocity of gameObject (Vector3)

Here is what the above code is Doing:
1. Get the Rigidbody component of the gameObject.
2. Get the velocity of the gameObject.

Similar Posts