How do I edit the ClampMagnitude line to be able to have separate values for the x and y axis?
Currently I have the one variable maxVel being put into it, but I would like to set separate values for x and y.
public float xmaxVel =10f;
public float ymaxVel =10f;
//public float maxVel = 10f;
void Update (){
GetComponent<Rigidbody2D>().velocity = Vector3.ClampMagnitude(GetComponent<Rigidbody2D>().velocity, maxVel);
Thanks!