Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question StartManualInteraction Use?

Discussion in 'XR Interaction Toolkit and Input' started by yarsrvenge, Nov 17, 2020.

Thread Status:
Not open for further replies.
  1. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    I'm looking at manually initiating a grab of a grabbable item. I started going down the "StartManuaInteraction" route but when I call this the grabbable is not going into the actual hand. I assume I have to do something. Do I need to manually move the object to the hand? I can see I need to manually deal with Ending theManual Interaction which I can trigger after they let go of the grip button. Just looking to see if anyone has used this since there isn't much in the way of documentation on this feature. It might be something that was added in the latest version.

    The use case here is for when reaching behind the back to retrieve an ammo clip, I set a trigger once the hand enters that zone and if the grab button is pressed I can initiate this startmanualinteraction to put the object in their hand.
     
  2. yarsrvenge

    yarsrvenge

    Joined:
    Jun 25, 2019
    Posts:
    87
    I think I managed to solve this without using StartManualInteraction. In the latest XR Toolkit the "ForceSelect" method of InteractionManager is now public, so you can simply call that and force the object into the interactor.
     
  3. DEGUEKAS

    DEGUEKAS

    Joined:
    Jul 12, 2018
    Posts:
    26
    it doesn't work for me either, how did you solve it?
     
  4. DEGUEKAS

    DEGUEKAS

    Joined:
    Jul 12, 2018
    Posts:
    26
    it already works, update the XR Interaction Toolki version to the latest available
     
  5. Riiich

    Riiich

    Joined:
    Sep 30, 2014
    Posts:
    18
    Can also confirm both are now working


    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.XR.Interaction.Toolkit;
    3.  
    4. public class XRSocketConnector : MonoBehaviour
    5. {
    6.     public XRSocketInteractor socket;
    7.     public XRBaseInteractable interactor;
    8.     public XRInteractionManager im;
    9.  
    10.     void Start()
    11.     {
    12.         // Both of these work in 1.0.0-pre.5
    13.         socket.StartManualInteraction(interactor);
    14.         // im.ForceSelect(socket, interactor);
    15.     }
    16. }
     
Thread Status:
Not open for further replies.