I want a GameObject to jump in the opposite direction at half of the current velocity after colliding with the ground, but at that point the velocity is already 0, so how do i store the previous velocity to use?
You can add a physics material to the ground and make it bouncy. If that’s too easy then you can use this:
void OnCollisionEnter2D(Collision2D c)
{
c.otherRigidbody.AddForce(c.relativeVelocity * 0.5f, ForceMode2D.Impulse);
}