/*Respected, I am trying to rotate the camera around a car when the user touches the screen, and when the user touches the car, then not rotate the camera, but I am not able to achieve my goal.  My car layer is "Car". And the other layer is "Default". Anybody can help me in this regard? Please.
*/

void Update()
{
        if (Input.touchCount > 0 || Input.GetMouseButton(0))
        {
#if !UNITY_EDITOR
            ray = sceneCamera.ScreenPointToRay(Input.touches[0].position);
#endif

#if UNITY_EDITOR
                ray = sceneCamera.ScreenPointToRay(Input.mousePosition);
#endif

                if (Physics.Raycast(ray, out var hitInfo, Mathf.Infinity, ~whatIsCar))
                {
                Debug.DrawRay(transform.position, hitInfo.point, Color.red, 5f);
                Debug.Log(hitInfo.collider.gameObject.layer);
                //    touch = Input.GetTouch(0);
                //      float mouseX = touch.deltaPosition.x * Time.deltaTime * _mouseSensitivity * -1;
                //      float mouseY = touch.deltaPosition.y * Time.deltaTime * _mouseSensitivity;
                float mouseX = Input.mousePosition.x * Time.deltaTime * _mouseSensitivity * -1;
                float mouseY = Input.mousePosition.y * Time.deltaTime * _mouseSensitivity;
                _rotationY += mouseX;
                _rotationX += mouseY;

                _rotationX = Mathf.Clamp(_rotationX, _rotationYMinMax.x, _rotationYMinMax.y);
                Vector3 nextRotation = new Vector3(_rotationX, _rotationY);
                _currentRotation = Vector3.SmoothDamp(_currentRotation, nextRotation, ref _smoothVelocity, _smoothTime);
                transform.localEulerAngles = _currentRotation;
                transform.position = _target.position - transform.forward * _distanceFromTarget; 
                
   } 
        } 
}