RaycastHit2D.Distance

The distance from the ray’s origin to the impact point.

RaycastHit2D.Distance

Property

Raycast Hit 2D RaycastHit2D
Distance Output the hit distance