Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
lnw1006's avatar
lnw1006
Honored Guest
2 years ago

How to use Forced grabbing

I'm using Meta All in one SDK68.0.2 with hand tracking, but I don't know how to program objects to automatically grab onto my hand, rather than having to grab them myself.

1 Reply

Replies have been turned off for this discussion
  • You can use ForceSelect():

    // Force Select on trigger enter
    private void OnTriggerEnter(Collider other)
        {
            Debug.Log("triggered: " + other.name);
            // modify GetComponent scope on line below as you need
            var handGrabInteractor = other.GetComponentInParent<HandGrabInteractor>(); 
            if (handGrabInteractor == null) return;
            handGrabInteractor.ForceSelect(handGrabInteractable);
        }

     To release you can use ForceRelease()