Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

raycasthit unity

RaycastHit hit;
/*
(Vector3) hit.point - the point where the ray has collided.
(Quaternion) hit.normal - the normal of the GameObject the ray has collided.
(float) hit.distance - the distance between the ray origin and hit.point.
(Transform) hit.transform - the transform of the GameObject the ray has hit
(Rigidbody) hit.rigidbody - rigidbody attached to GameObject ray collided,
							if no rigidbody is attached, value is null.
(Vector2) hit.textureCoord - the coordinate of the point on the texture
							 of the GameObject the ray collided.
*/
 
PREVIOUS NEXT
Tagged: #raycasthit #unity
ADD COMMENT
Topic
Name
1+7 =