RayHit
struct RayHit
RayHit is the result of a ray query. Hit is false when nothing was found; Node is the body, Collider the node of the shape that was hit.
Collider field
field Collider NodeRef
References the node containing the collider shape that was hit; it may be a child of the body returned in Node.
Distance field
field Distance float
Stores distance from the query origin to the hit in world units, not a normalised fraction of the query length.
Hit field
field Hit bool
Reports whether the query found a collider. Check this before using the other result fields; a miss returns an empty result.
Node field
field Node NodeRef
References the rigid-body node that owns the hit shape; Collider identifies the actual shape node.
Normal field
field Normal Vec2
Stores the surface normal at the hit point in world space when Hit is true.
Point field
field Point Vec2
Stores the hit position in world coordinates and world units when Hit is true.