|
I am trying to determine the object that I touch on the iPhone by casting a ray from the camera position to the touched position on the screen. It does not work. When I dray the ray as a Gizmo, I can see the ray moving outside the game region and also into opposite directions as if the scale and orientation are wrong. What am I doing wrong? Below is the script:
(comments are locked)
|
|
Try using Input.mousePosition instead of getting the position of the touch. If that works, then you know that it's a coordinate system error. ScreenPointToRay and Input.mousePosition both assume (0,0) is in the bottom left. I don't know off the top of my head what iPhoneTouch.position uses.
(comments are locked)
|
|
Check this one out, might find it useful:
(comments are locked)
|
|
I think it's because you're using a Vector3 instead of a Vector2: should be: or just add the 3rd vector direction (z)
Jun 05 '12 at 07:04 AM
shaystibelman
(comments are locked)
|
