All of these solutions that I google do NOT work
Well a simple way would be to just get the value of the rotation before the collision and then set it to that after the collision… you could do this a few ways
Quaternion rotation;
OnCollisionEnter(){
rotation=transform.rotation;
}
OnCollsionExit(){
transform.rotation=rotation;
}
Or if you are using OnCollision()
Quaterion rotation;
OnCollision(){
rotation=transform.rotation;
Invoke("ResetRotation",.5f);
}
public void ResetRotation(){
transform.rotation=rotation;
}
You will have to fill in the collision parameters correctly.