Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity screentoworldpoint

public Camera yourCamera;
public Vector3 yourPosition;

yourCamera.ScreenToWorldPoint(yourPosition);



//For example to get positions of the mouse

Camera.main.ScreenToWorldPoint(Input.MousePosition);
Source by gamedev.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #unity #screentoworldpoint
ADD COMMENT
Topic
Name
9+1 =