I am trying to create a puzzle where depending on what object you place on a pedestal the environment changes. I have all of the code working for moving the objects the only thing I can’t get working is to find the object that is in the XR Socket Interactor.
Does anyone know the code or a method to assign the object in the XR Socket to a GameObject so I can pass it to my scripts to process?
Thank you for the advice. I’ve had a look into implementing the SelectTarget to get the current object but I can’t use the returned value. Is there a way to convert the XRBaseInteractable value to a GameObject or a way to access the selected object to pull values from it?
XRBaseInteractable is a monobehaviour. If you want access to its gameObject just use var selectedGameObject = mySocket.selectTarget.gameObject;
This does assume that you have checked that selectTarget isn’t null.