I am trying trying to added an accessibility feature to an app we are working on. There is only one thing in the experience that the player will pick up currently which is a paddle for a Kayak. We showed it around during demos and some disabled people had difficulty in using the Quest 2 controllers grip buttons.
I want to link whatever code is used in the when the grip button is pressed to an OntriggerEnter that will call it and make the hand pick the paddle up automatically as soon as the hands touch the paddle. I don’t know where that code is or how to access it. My best guess is that it is in the XRBaseInteractor class somewhere.
It’s in an older version of Unity: 2020.3.44f1 and the XR interaction toolkit version is 2.3.0.
I think You could create script for the paddle to force selection upon hover from Your interactor. For this You should use an InteractionManager class that is managing all interactions. You will get the reference to it via hovering interactor or interactable that is being hovered.
E.g.
public void ForceSelect(BaseInteractionEventArgs args)
{
var interactor = args.interactorObject as XRBaseInteractor;
interactor.interactionManager.SelectEnter(interactor, args.interactableObject as IXRSelectInteractable);
}
Attach this method via inspector on paddle interactable in Hover Entered event.
Please try It and let me know if it works.
It looks good but the SelectEntered() Method is not available with the versions I have to use but I did find the StartManualInteraction() Method works for what I need although it is deprecated. thanks anyway, this could be useful in the future.