unity rigidbody rotating the object after hit with other rigid body code example
Example: hwo to prevent rotation after hitting an object in unity
private void OnCollisionEnter(Collision collision)
{
GetComponent<RigidBody>().freezeRotation = true;
}