"how to zoom where i have mouse cursor in unity" Code Answer's
You're definitely familiar with the best coding language C# that developers use to develop their projects and they get all their queries like "how to zoom where i have mouse cursor in unity" answered properly. Developers are finding an appropriate answer about how to zoom where i have mouse cursor in unity related to the C# coding language. By visiting this online portal developers get answers concerning C# codes question like how to zoom where i have mouse cursor in unity. Enter your desired code related query in the search bar and get every piece of information about C# code related question on how to zoom where i have mouse cursor in unity.
how to zoom where i have mouse cursor in unity
public float zoomSpeed; public float minZoom; public float maxZoom; void Update() { Zoom(); } void Zoom() { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit point; Physics.Raycast(ray, out point, 1000); Vector3 Scrolldirection = ray.GetPoint(5); float step = zoomSpeed * Time.deltaTime; // Allows zooming in and out via the mouse wheel if (Input.GetAxis("Mouse ScrollWheel") > 0 && Scrolldirection.y > minZoom) { transform.position = Vector3.MoveTowards(transform.position, Scrolldirection, Input.GetAxis("Mouse ScrollWheel") * step); } if (Input.GetAxis("Mouse ScrollWheel") < 0 && Scrolldirection.y < maxZoom) { transform.position = Vector3.MoveTowards(transform.position, Scrolldirection, Input.GetAxis("Mouse ScrollWheel") * step); } }
Source: answers.unity.com
All those coders who are working on the C# based application and are stuck on how to zoom where i have mouse cursor in unity can get a collection of related answers to their query. Programmers need to enter their query on how to zoom where i have mouse cursor in unity related to C# code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about how to zoom where i have mouse cursor in unity for the programmers working on C# code while coding their module. Coders are also allowed to rectify already present answers of how to zoom where i have mouse cursor in unity while working on the C# language code. Developers can add up suggestions if they deem fit any other answer relating to "how to zoom where i have mouse cursor in unity". Visit this developer's friendly online web community, CodeProZone, and get your queries like how to zoom where i have mouse cursor in unity resolved professionally and stay updated to the latest C# updates.