โWrist Look Event
Last updated
Last updated
The WristLookEvent
class, is designed to detect and respond to specific wrist and head orientations. This script is useful for applications, such as showing or hiding UI elements based on the user's wrist position relative to their head.
Wrist Look Event can be added to any transform and will trigger when the back of the hand is facing towards the given camera and within the given max distance and angle preciseness
Hand (Hand): A reference to the Hand
object, typically a VR hand controller or a 3D hand model.
Head (Camera): A reference to the Camera
object, representing the user's head, typically the main camera in a VR setup.
Max Distance (float): The maximum distance between the hand and the head for the event to be considered. It defines how far the wrist can be from the head to activate the events.
Angle Preciseness (float): A value between 0 and 1 that specifies how accurately the hand needs to be pointing towards the face for the event to trigger. A value of 0 means any angle will work, while 1 requires precise alignment.
Disable While Holding (bool): If set to true, the events won't trigger if the hand is holding an object.
On Show (UnityHandEvent): An event that is invoked when the wrist is detected in the specified orientation and distance relative to the head, and not holding any object.
On Hide (UnityHandEvent): An event that is invoked when the wrist moves out of the specified orientation or distance, or if the hand starts holding an object.