Ray Camera.main.ScreenPointToRay (Vector3 POS) Returns a ray from the camera to the screen to specify a point
Ray Camera.main.ViewportPointToRay (Vector3 POS) Returns a ray Ray from the camera to the viewport (invalid outside the viewport) specify a point
Raycasthit Ray projection collision Information
BOOL Physics.raycast (Vector3 origin, Vector3 direction, float distance, int layermask)
True if Ray casts intersect with any collider, otherwise false.
BOOL Physics.raycast (Ray Ray, Vector3 direction, raycasthit out hit, float distance, int layermask)
A light that can collide with all the collider in the scene and return details of the collision ().
BOOL Physics.raycast (Ray Ray, float distance, int layermask)
True if Ray casts intersect with any collider, otherwise false.
BOOL Physics.raycast (Vector3 origin, Vector3 direction, raycasthit out hit,float distance, int layermask)
True if Ray casts intersect with any collider, otherwise false.
Raycasthit[] Raycastall (Ray Ray, float distance, int layermask)
Casts a ray and returns all collisions, that is, projecting the light and returning a raycasthit[] structure.
if (Input.getmousebutton (0))
{
Ray Ray = Camera.main.ScreenPointToRay (input.mouseposition);
Raycasthit Hitinfo;
if (Physics.raycast (Ray,out hitinfo))
{
Gameobject gameobj = HitInfo.collider.gameObject;
Debug.Log ("Click Object name is" + gameobj.name);
}
}
Unity3d emission Ray Ray