This is the code I’m currently using:
if(Input.GetMouseButtonUp(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
int mask = ~(1 << 8);
RaycastHit col = Physics.RaycastAll(ray, 100f);
foreach(RaycastHit info in col)
{
GameObject hit = info.collider.transform.root.gameObject;
Debug.Log (“hit” + hit);
if(hit.name.ToLower() == “texture”)
{
Debug.Log(“hit texture”);
}
}
}
What I want to do… is find the location on the plane I hit with the raycast. I need to know if I’m clicking towards the middle of the plane, or towards an edge.
So, If the ray hits a gameObject with the name “texture”, I want to see where on that gameObject the ray actually hit relative to the gameObject’s locations. This is strictly dealing with planes.