👐
Hand & Finger Tracking for Unity
HomepageSupportContact
  • Hand Tracking Unity Plugin
    • Overview
    • System Requirements
    • Installation
    • QuickStart
    • Supported Joints
  • Help & Support
    • Ask for help
    • Request a feature
  • Examples
    • Detect hand and retrieve joints
    • No Code: Detect and visualize hands from a Sprite
    • Detect and visualize hands from a Sprite
    • Detect and visualize hands from a video
    • Use webcam to detect and visualize hands (2D Canvas)
    • Use webcam to detect and visualize hands (3D World space)
  • API Reference
    • Finger
      • Index
      • Middle
      • Palm
      • Pinky
      • Ring
      • Thumb
    • FingerJoint
    • FingerJointType
    • Hand
    • HandExtensions
    • HandSide
    • HandTracker
  • UI Reference
    • HandManager
    • HandViewer
    • HandVisual
    • ImageView
    • StreamSource
      • SpriteSource
      • VideoSource
      • WebcamSource
    • HandTrackerExtensions
    • WebcamSelector
Powered by GitBook
On this page
  • Constructors
  • Properties
  • Methods
  • Example
  1. UI Reference

HandVisual

Visualizes finger joints using LineRenderer.

PreviousHandViewerNextImageView

Last updated 1 year ago

public class HandVisual : MonoBehaviour

Inherits class.

Constructors

Name
Description

HandVisual()

Creates a new HandVisual object.

Properties

Name
Type
Description

Hand

The hand associated with the visual.

Offset

The offset associated with the visual.

Is2D

bool

Whether it shows the 2D or 3D positions.

Image

The ImageView associated with the visual.

Methods

Name
Return Type
Description

void

Visualizes the hand using LineRenderer objects. If an optional offset parameter is provided, it relocates the hand's position in 3D by the specified offset value. The offset is measured in meters.

Toggle(bool)

void

Sets LineRenderer objects to visible when set to true.

Example

The example shows how to visualize a detected hand with the HandVisual class.

To visualize a hand, first, you need to instantiate a GameObject and get the component HandVisual. Then load the detected Hand to the specified ImageView.

// Assign the prefab in the Editor.
[SerializeField] private GameObject _handPrefab;

// Instatiate GameObject.
GameObject handObject = Instantiate(_handPrefab, transform);

// Get HandVisual component.
HandVisual handVisual = handObject.GetComponent<HandVisual>();

// Visualize hand.
handVisual.Load(hand);

Load(,)

UnityEngine.MonoBehaviour
Hand
UnityEngine.Vector3
ImageView
Hand
UnityEngine.Vector3