Check the distance of the intersection point from the raycast starting point. Keep track of the closest entity hit, apply logic to the closest hit entity
Check the distance of the intersection point from the raycast starting point. Keep track of the closest entity hit, apply logic to the closest hit entity