velocity of gameobject unity code example
Example 1: unity get velocity of gameobject
Rigidbody rb = GetComponent<Rigidbody>();
rb.velocity; // Velocity of gameObject (Vector3)
Example 2: unity how to set rigidbody velocity
Vector3 velocity = new Vector3(10f/*x*/, 10f/*y*/, 10f/*z*/);
GetComponent<Rigidbody>().velocity = velocity;