I'm trying to write a camera script which will maintain the perspective point which I'm looking at while rotating.
public void RegisterRotationControls()
{
var horizontal = CrossPlatformInputManager.GetAxis(InputAxisName.Horizontal.ToString());
offsetX = Quaternion.AngleAxis(horizontal * turnSpeed, Vector3.up) * offsetX;
transform.position = player.position + offsetX;
transform.LookAt(player.position + PlayerOffset);
}
Currently this script is only working properly when the camera is looking at the player, however the camera has freedom to move position yet the rotation should maintain relativity to the center.
The top row dipicts the current behavior, while the bottom depicts what should be occuring