Camera.ScreenToWorldPointfunction ScreenToWorldPoint (position : Vector3) : Vector3DescriptionTransforms position from screen space into world space. Screenspace is defined in pixels. The bottom-left of the screen is (0,0); the right-top is (pixelWidth,pixelHeight). The z position is in world units from the camera.
JavaScript
// Draw a yellow sphere in the scene view at the position using UnityEngine; import UnityEngine |
