Hey guys, I was able to clamp my camera rotation for a more realistic FPS effect, although when my player hits the max angle, they are pushed back.
Does anyone have any insight on how to keep the player facing up/down without an awkward push back?
private void RotateCamera()
{
Vector2 inputValues = new Vector2 (Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y"));
inputValues = Vector2.Scale(inputValues, new Vector2(lookSensitivity * smoothing, lookSensitivity * smoothing));
smoothedVelocity.x = Mathf.Lerp(smoothedVelocity.x, inputValues.x, 1f / smoothing);
smoothedVelocity.y = Mathf.Lerp(smoothedVelocity.y, inputValues.y, 1f / smoothing);
currentLookingPos += smoothedVelocity;
transform.localRotation = Quaternion.AngleAxis(-currentLookingPos.y, Vector3.right);
player.transform.localRotation = Quaternion.AngleAxis(currentLookingPos.x, player.transform.up);
currentLookingAt.y = Mathf.Clamp(currentLookingAt.y, -80f, 80f);
}