Hi, I trying to make my camera position orbit around my player with only Horizontal axis of the Joystick. The problem is it doesn’t stop and just keeps going around the player.
///JoyStick Rotation Around Player/////
if(target){
x += horz * xSpeed * 0.02f;
Quaternion rotation = Quaternion.Euler (0,x,0);
Vector3 wantedPosition = new Vector3(0, height, -distance);
Vector3 position = rotation * wantedPosition + target.position;
transform.rotation = rotation;
transform.position = Vector3.Lerp (transform.position, position, Time.deltaTime * damping);
}