So when my player gets hurt, he is forced back with
rigid.velocity = new Vector2(d, 10.0f);
Sometimes when the player is hit by a moving enemy, an unexpected extra force in multiplied into the force back. Visually it’s annoying and not fun. Is there a way to have the force back at a consistent magnitude?
I would recommend trying to figure out where the extra force originates from, because this solution is somewhat of a band-aid to the underlying issue perhaps.
Anytime you set the velocity explicitly (not using AddForce, but doing velocity=vector), it’s effectively overwriting any velocity that was already there. So unless you were manually adding in the previous velocity, I’m not sure zeroing out the velocity would affect your result.