Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Riiich's avatar
Riiich
Member
4 years ago

"Attach socket" with Oculus Interaction SDK

I'm trying to recreate the "attach socket" (XRSocketInteractor) from Unity's XR Interaction Toolkit.

 

Has anyone had any success? I've read through the documentation but can't come up with a simple way to do this. I've even tried writing my own script with an OnTriggerEnter using both

grabInteractable.AddSelectingInteractor(grabInteractor);

 and

grabInteractor.Select();

but still haven't got a complete snap attach..

I've gotten the grabbable object to turn green (be Selected) seen with the "Interactable Debug Visual" script but the object doesn't "auto move" to the transform point and I'd rather see if there is indeed a proper way to do it.

 

Any ideas?

7 Replies

Replies have been turned off for this discussion
  • KiwiBash's avatar
    KiwiBash
    Honored Guest

    Hello,
    I created for my own project a socket.
    You can find it here https://github.com/BlauBierBube/Socket_Oculus_Integration_SDK.

    I created an emptyobject and added an collider to it, and a child which i used as attach.
    The bool "_activeTransformer" from the Grabbable script set i to public to get access to it.

    I am just a beginner in scripting and working with VR but i hope it helps.

    • nachoburritoman's avatar
      nachoburritoman
      Explorer

      That worked amazingly, do you know how I would be able to remove the object after it is attached. I can grab onto it and move it around,  but I can't get it to detach.

      • KiwiBash's avatar
        KiwiBash
        Honored Guest

        The detaching should work, but it's possible the object collider and grabscrips are not moved probably to the Attach.
        In my scribt I just move the target (Object with the collider and all childs) to this possition and change the parent to the Attach.

    • maokru's avatar
      maokru
      Honored Guest

      This is exactly what i need, but its there any posibility to upgrade it to the oculus v50? :0

       

      Sorry to ask but, code its not my strong area

  • You can use Snap Interactor and Snap Interactable for this function, snap interactor is added to the gameobject which is used for grabbing and snap interactable to the position where the gameobject should be placed when it enters the area.