hi i have a problem scripting the code for controlling the camera to zooom looking at the mouse pointer i have tried for 2 days but no help please help !
how to code this ?
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
Camera.main.transform.LookAt( Camera.main.transform.position + ray.direction);
Camera.main.fieldOfView = 30.0f;
Your camera must have the tag “MainCamera” in order to access it with “Camera.main”.