unity mouse position 3d code example Example: get mouse position unity Vector3 worldPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);