Hello.
Bare with me since this is my first Unity project. Literally called Hello World. Yikes.
So the issue I am running into is the following.
- I’ve setup an XR rig with Left and Right controller (XR interactors)
- I’ve made a Gun with a custom gun script (XR interactable
When I press the trigger I want to call a function in the Gun script. This works but it doesn’t allow much configuration. I’ve seen the action based samples, but I would like to use C# to program some behaviors. Things like Threshold, Hold/Charge, DoubleTriggers, Gestures, Auto-repeat etcetera.
I’ve been able to get this working a little by NOT using the Activation event of the Interactable. But instead I have an InputAction in the Gun script that uses inputAction.ReadValue<float>()
. This allowed me to write the logic I want.
However the Gun is now not aware of which hand has picked it up. How should I handle this? I’m aware of how this is supposed to work. The role of the interactor, interactable and the interactionmanager. Would another approach be better to get the flexibility I want?
Is there a way to propagate the Interactor event arguments to the Interactable through the InteractionManager?
Thanks