Problem with getting mouse position

Hi Abhinav,

Please refrain from posting screenshots of your code because it’s impossible to copy and paste lines from them. Instead, paste it here and format it properly.

Input.mousePosition.x/Screen.width normalises the screen. We get values ranging from 0 to 1. We multiply the value by 16 to get values ranging from 0 to 16.

The bottom left World Space coordinate in our camera viewport is (0, 0), our right edge is at x = 16.

Did this clear it up for you?


See also: