Iterate through a list of all colliders detected by a LineCastThe colliders iterated are sorted in order of increasing Z coordinate. No iteration will take place if there are no colliders within the area.
From Game Object
Start ray at game object position. Or use From Position parameter.
From Position
Start ray at a vector2 world position. Or use fromGameObject parameter. If both define, will add fromPosition to the fromGameObject position
To Game Object
End ray at game object position. Or use From Position parameter.
To Position
End ray at a vector2 world position. Or use fromGameObject parameter. If both define, will add toPosition to the ToGameObject position
Min Depth
Only include objects with a Z coordinate (depth) greater than this value. leave to none for no effect
Max Depth
Only include objects with a Z coordinate (depth) less than this value. leave to none
Layer Mask
Pick only from these layers.
Invert Mask
Invert the mask, so you pick from all layers except those defined above.
Colliders Count
Store the number of colliders found for this overlap.
Store Next Collider
Store the next collider in a GameObject variable.
Store Next Hit Point
Get the 2d position of the next ray hit point and store it in a variable.
Store Next Hit Normal
Get the 2d normal at the next hit point and store it in a variable.
Store Next Hit Distance
Get the distance along the ray to the next hit point and store it in a variable.
Loop Event
Event to send to get the next collider.
Finished Event
Event to send when there are no more colliders to iterate.