how to know the x axis velocity of an object in unity code example
Example: rigidbody velocity c# unity
//for rigidbody2D
GetComponent<Rigidbody2D>().velocity =new Vector2(40,0);
//for rigidbody2D
GetComponent<Rigidbody2D>().velocity =new Vector2(40,0);