Im trying to make a camera following the player and rotating alongside with him. But then my camera reaches the 90deg(top) it changes to upside down. I twant to make it like a freely sandbox flying in the space.
Video shows the problem
1
void Start () {
}
public Camera camera;
void Update(){
camera.transform.LookAt(transform);
transform.Rotate(Vector3.up, CrossPlatformInputManager.GetAxis("Horizontal") *1 * 1.5F);
transform.Rotate(Vector3.left, CrossPlatformInputManager.GetAxis("Vertical")*1 * 1.5F);
}
}