how to prevent rotation in unity code example
Example: hwo to prevent rotation after hitting an object in unity
private void OnCollisionEnter(Collision collision)
{
GetComponent<RigidBody>().freezeRotation = true;
}
private void OnCollisionEnter(Collision collision)
{
GetComponent<RigidBody>().freezeRotation = true;
}