unity get velocity of gameobject

Code Example - unity get velocity of gameobject

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