ProximityInteractionHand

Description

Used to handle interactions with objects within a certain proximity of the hand. It inherits from the InteractionHand class and overrides its StartInteraction and EndInteraction methods.

Public methods

override void StartInteraction()

  • calls the base StartInteraction method

  • checks for any colliders within a sphere with a certain radius around the hand's position using the ContactCheck method

  • if colliders are found calls UpdateInteraction()

override void EndInteraction()

  • calls the base EndInteraction method

  • calls CheckForRelease()

virtual Collider[] ContactCheck()

  • uses Unity's OverlapSphere method to check for colliders within the sphere, passing in the hand's position, the radius of the sphere, and the LayerMask for filtering the colliders

  • stores the result of the check in the contactResult variable, which is an array of colliders that were hit by the sphere

  • returns the contactResult variable; an array of colliders that were hit by the sphere.

Last updated