So I’ve been trying to draw an object exactly where the mouse cursor is.
I’m getting the mouse position like this:
x = Input.mousePosition.x;
y = Input.mousePosition.y;
After that I use this:
…
sphere.transform.position = new Vector3 (x, y, 0);
to draw an object right where my cursor is at that point.
But the thing is, actual mouse coordinates and the coordinates of a new object do not match. There’s a distance between those two points.
That’s why I decided to make my own cursor inside the scene and
I’ve been trying to tweak that distance somehow by adding and substracting from the X and Y but I still have to move the cursor somewhere to the right or to the left of the scene to actually draw in that scene. Moreover, it seems like the speed of the actual cursor and my custom cursor do not match at all so when I move the cursor from the left side of the screen to the right side my custom cursor crosses a distance that is like 20 times shorter and I can draw only inside that small box.
I have no idea if that made sense but that is as clear as I could explain.
I have some ideas why, but it would be amazing to get some answers and maybe a bit of help solving that issue.
Thanks guys. Also, girls.