๐ฆGrabbable Highlighter
Last updated
Last updated
The HandGrabbableHighlighter
class manages the highlighting of grabbable objects within reach of a hand in Unity. It periodically updates the highlighted object based on the hand's position and orientation.
Palm Forward Right Direction
: When choosing between multiple targets to highlight, the hand will favor objects in the palm's local forward direction (0) or the palm's local right direction (1), or a blend between the two (recommended 0.5-0.75).
Returns the closest raycast hit from the hand's highlighting system. If no highlight is present, returns a blank raycasthit.
Returns:
RaycastHit
: The closest raycast hit.
Finds the closest raycast hit from a cone of rays and returns the average direction of all hits.
Parameters:
closestHit
: Outputs the closest raycast hit.
grabbable
: Outputs the closest grabbable object.
dist
: The distance to check for hits.
layerMask
: The layer mask to use for raycasting.
target
: An optional target grabbable object to check for.
Returns:
Vector3
: The average direction of all hits.