#screentoworldpoin

1 messages · Page 1 of 1 (latest)

old jetty
#

It’s using the canvas as a reference instead of the camera. How do i fix that?

frozen thorn
#

Camera.ScreenToWorldPoint only calculates a position based on an input.
It does not - and by the very nature of C# cannot in this case - change the value you give it.

What you want to do is something like this cs Vector3 position = cam.ScreenToWorldPoint(Input.mousePosition); transform.position = position;