When I try using a quaternion to control the rotation of my character, the code works but it runs at about 2 fps. When I comment out the following function in my code, the game runs at 60+ FPS. Also when the character is moving around, the framerate increases back to normal, and when I stop moving, it will drop back down to about 2 fps. It takes about 2 seconds of moving for the framerate to go back up to 60+ fps.
The code that appears to be causing the problem is:
void Turning ()
{
Quaternion newRotation = Quaternion.LookRotation (movement);
playerRigidbody.MoveRotation (newRotation);
}
movement is a Vector3 variable declared at the top of the code. Turning is called in FixedUpdate.
My pc is running a GeForce GTX 970 and an AMD FX-6300 at 4GHz with 8GB of RAM.