find the relative velocity of a rigidbody in unity code example
Example 1: unity how to set rigidbody velocity
Vector3 velocity = new Vector3(10f/*x*/, 10f/*y*/, 10f/*z*/);
GetComponent<Rigidbody>().velocity = velocity;
Example 2: rigidbody.velocity.magnitude
//speed of rigidbody in m/s
float speed = rigidbody.velocity.magnitude;