I’d like to trigger an event (say turning a light on and off) by pressing the trigger button. There’s no interactable object and no UI object - I simply want the light to turn on when I press the trigger, and turn off when I let it go. I’m able to do this with the grip button by adding an event to XR Ray Interactor / Interactor Events / Select Entered and Select Exited with GameObject.SetActive (bool), but I’m using the grip button to pick things up, and I don’t want the light to turn on and off every time I pick up an object. I’m not using the trigger to do anything else, so I’d like to map the light switch to the trigger button (besides, it makes more sense to me to use the trigger as a light switch instead of the grip). If Interactor Events had an Activate Entered and Activate Exited I could use that, but those options aren’t available in XR Ray Interactor. It seems like this should be pretty straightforward to implement but I haven’t been able to come up with anything. Any ideas?
Trying to figure this out myself. I put a XR Simple Interactable on my target object and call a custom function from Activate from the Interactable Events. This requires pressing the grip button and the trigger to call the function. Like you I think, I’d like to be able to point my ray at a target object and be able to pull just the trigger to call a function. Maybe XRIT is predicated on having to Select first an object to be able to then Activate it? I have done this successfully with custom scripts, but I’d like to try to do it directly.
Oh reading another thread reminded me. You can set the ray to “Hover To Select” and “pulling the grip button to select” is no longer needed so you get just pulling the trigger button.
I would solve this by capturing objects you hover, and then writing listening for input yourself and pushing your input action code into the object returned by the hover enter args.
