I cant figure out how to do it. Whenever i collide into another game object it sends me spinning on the x and y axis. My game is clamped on the y axis and that stays at 0. my controller for the player uses the Y rotation so this code below doesnt work because then i cant turn my player:
void Update () {
float yMovement = (turnSpeed * 20f * Time.deltaTime * Input.GetAxis("Horizontal"));
transform.Rotate (0,yMovement,0);
transform.rotation = Quaternion.Euler(0,yMovement,0);
}
}