- Home /
XR toolkit and auto grab
Hi
In my application i instantiate differents tools object for player and i try to autograb them in his hand. I don't understand how can i do that by script.
Answer by EmperorPenguin000001 · Feb 04, 2021 at 02:05 PM
public class Autograb : MonoBehaviour
{
public XRInteractionManager interactionManager;
public XRGrabInteractable grabInteractable;
public XRDirectInteractor directInteractor;
public void AutoGrab()
{
interactionManager.ForceSelect(directInteractor, grabInteractable);
Debug.Log("AutoGrab");
}
}
I'm only a noob at this stuff but I found Force select to make two things interact. seems to work
thank you for your help, where do you put this code ? and how to you know witch hand will grab this ? i'm confuse
so grabinteractable is the hand, directIterator is the object to grab But what is XRInteraction$$anonymous$$anager ?
Answer by raitoryuukuu · Feb 09, 2021 at 05:00 PM
did you found out since august?
i used the solution of EmperorPenguin , it work but doesnt work at the same time, i dont really know what object is suppose to have XT interactionManager on it, so nothing is grab at the end.
Your answer
Follow this Question
Related Questions
XR Interaction Toolkit - Grab Object Persistent 0 Answers
How do I replace an object in hand (XR Interaction toolkit). 0 Answers
Can't grab object out of snap zone 2 Answers
Something is off with VR grabbing 0 Answers
Grabbing Objects using VRTK 2 Answers