{
rb.freezeRotation = true;
if(collisionInfo.collider.name == "Ground")
{
rb.AddForce(0, 150, 0);
rb.freezeRotation = false;
}
rb.freezeRotation = false;
rb.freezeRotation.y = true;
}
{
rb.freezeRotation = true;
if(collisionInfo.collider.name == "Ground")
{
rb.AddForce(0, 150, 0);
rb.freezeRotation = false;
}
rb.freezeRotation = false;
rb.freezeRotation.y = true;
}
You can do it from the inspector like this