In my Unity3d game, I want to get the world position that was touched, when I touch a specific object, regardless of all objects that are in front of it.
How would I do that, I only know Camera.ScreenPointToRay(...), but for some reason that does not work properly?
OK - one cannot answer the question with the information I provided.
In order to determin the point, where the Ray hit the object, I used RaycastHit.transform.position
(which refers to the Transform object that was hit) as opposed to RaycastHit.point
(which refers to the Vector3
in world space, where the RaycastHit
happened).