Skip to content

Physics Raycast Get Aim Point

Calculates an aim point along a ray using optional hit info plus minimum/maximum distance limits.

Use this after a Physics Raycast action to convert hit/no-hit results into a stable target point.

Parameters

Parameter Description
Ray Input ray (origin + direction), usually from a raycast action Store Ray output.
Hit Info Optional RaycastHit from a previous raycast. If missing or no collider hit, the aim point uses Max Aim Distance.
Min Aim Distance Minimum allowed distance from the ray origin.
Max Aim Distance Maximum allowed distance from the ray origin.
Aim Point Optional output world-space aim point.
Aim Distance Optional output distance from origin to the aim point.

Notes

  • Aim distance is clamped between Min Aim Distance and Max Aim Distance.
  • If a hit is closer than Min Aim Distance, the result is pushed out to Min Aim Distance.
  • If no valid hit exists, the aim point is placed at Max Aim Distance along the ray.