Skip to content

RaycastHit

The RaycastHit class provides information about raycasting.

成员变量

RaycastHit.collider : Collider
(Read-only) The collider that was hit by the ray.
RaycastHit.transform : Transform
(Read Only) The Transform component of the collider that was hit by the ray.
RaycastHit.point : Vector3
(Read Only) The collision point between the ray and the collider in world space.
RaycastHit.rigidbody : Rigidbody
(Read Only) The rigidbody of the collider hit by the ray.
RaycastHit.normal : Vector3
(Read-only) The normal of the surface hit by the ray.
RaycastHit.textureCoord : Vector2
(Read-only) UV texture coordinates of the collision position.
RaycastHit.distance : number
(Read-only) The distance from the origin of the ray to the point of collision.