Between the Poke Interactor, Direct Interactor and Ray Interactor, we have a ton of behaviors’ that we need to manage. If we interact with an Object that can use all three Interactables, which one gets priority?
To make sure our players have a more consistent experience, we can actually handle the hierarchy of importance using the XR Interaction Group.
XR Interaction Group
To add it, we just need to do the following.
- Expand XR Origin and select the LeftHand Controller
- Add Component ‘XR Interaction Group’
- XR Interaction Manager =XR Interaction Manager
- Starting Group Members, hit the ‘+’ symbol 3 times
- Drag the Direct, Poke and Ray Interactor into the empty slots
- Group Name = ‘Left’
- Add Component ‘XR Interaction Group’
If no Interactor is chosen to override another, then the order that they are in based on the Starting Group Members determines which Interactor has priority.
Feel free to experiment, but for my own personal projects, I find it best to go Poke, Direct and Ray interactors. The thought process being going from the most direct to most indirect form of interactor.
Testing Things Out
In order to try out the XR Interaction Group, Let’s set the Poke Interactor to Override the Direct Interactor and the Direct Interactor to Override the Ray Interactor.
In the Scene, make sure to have some Grab Interactables available and also something that can Interact with a Poke Interactor.
Once you’ve booted into the Scene, we should notice that the Ray Interactor will actually turn off if we get close with the Direct Interactor or Poke Interactor.