Search Unity

Question Problems with XRSocketInteractor

Discussion in 'VR' started by Vanz, Mar 19, 2021.

  1. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    Created a waist socket, using Valem's tutorial:


    Works good for the most part but now the socket picks up everything. As I pass by a table it grabs an object off the table. I would like it to only accept object given to it by hand.

    So I thought I would write a script and say "If object in hand" and "Object OnTriggerEnter the Socket" are both true, then enable XRSocketInteractor script and if any object exits the socket object, turn off XRSocketInteractor by default. I felt this should have worked but didn't, was stumped for while so I set up a Test with one simple object (bottom object) with the XRSocketInteractor attached and let another object right above it fall into it with the bottom object having my script.

    To my surprise the XRSocketInteractor triggered a "OnTriggerExit" for no reason? If I turned off XRSocketInteractor (check mark by component) the upper object triggered the "OnTriggerEnter" properly as if fell to the lower object and then "OnTriggerExit" properly as it fell through lower object. Then I turned XRSocketInteractor back on and ran the test again, then to my surprise the falling object triggered the "OnTriggerEnter" properly but half way through an "OnTriggerExit" was recorded by the lower object (that contains XRSocketInteractor). Well this seems very odd and totally messes me up now.

    A couple questions:
    • is this an XRSocketInteractor bug? If not how can I stop it from generating an "OnTriggerExit" when there shouldn't be one (imo)
    • Any other way I can stop my waist socket from grabbing all objects, I only want it to take an object put into it by a hand?

    Thanks... hope that was clear...

    Vanz
     
  2. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    bump, no one else see this issue, or do you just ignore?