So im trying to make a camera system where you look at an object and orbit around it and run smoothly this is my code
GameObject target;
void Start(){
target = GameObject.Find("Player");
}
void Update(){
this.transform.LookAt (target.transform.position);
transform.RotateAround (target.transform.position, new Vector3(Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"), 0), 150 * Time.deltaTime);
}
im trying to get it to not flixer when you look some directions and to be apple to zoom in and out of the object