unity get mouse position 1

unity get mouse position

Vector3 worldPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);

Here is what the above code is Doing:
1. We’re getting the mouse position in screen coordinates.
2. We’re converting the mouse position from screen coordinates to world coordinates.

Similar Posts