Question Actionable way to activate triggers via vr controller button press?

AshAuryn

Moderator
Staff member
Developer
Featured Contributor
Messages
626
Reactions
3,478
Points
123
Website
www.patreon.com
Patreon
ashauryn
I've seen Acid Bubble's script for binding triggers to keyboard keys. And I understand that VR controller buttons can be bound to actions, but not triggers. Has anyone thought of a novel way to activate triggers besides collision, logic, or UI button?

For sake of argument, let's say I wanted to create a "sperm gun" that can be held by the player and activated by controller button press. My initial thought was to parent a UI button to the "gun" in such a way that it sits directly in front of the VR controller's "laser" so that a button press would activate the button. But I'm not sure that's possible since the "laser" would disappear once grab is activated. I'm sure there is an easier way to accomplish what I'm trying to do.
 
Hi! :D VaM's VR controllers input is not "overwritable", which means you have to kind of "cancel out" whatever the controller did, and do what you need. That can be done in a plugin, though it will also do what the trigger would, e.g. if it selects another atom, then you need (in code) to re-select the former one the frame after and re-position it where the hand is now (all theoretically, I didn't actually do this). But it's feasible :) At least, I think...
 
Upvote 0
Hi! :D VaM's VR controllers input is not "overwritable", which means you have to kind of "cancel out" whatever the controller did, and do what you need. That can be done in a plugin, though it will also do what the trigger would, e.g. if it selects another atom, then you need (in code) to re-select the former one the frame after and re-position it where the hand is now (all theoretically, I didn't actually do this). But it's feasible :) At least, I think...

Turns out the laser pointer does remain after gripping with the trigger, at least on the index controller. I encased the cylinder object with a box made of 6 inward facing UI buttons to make my "squirt gun".

VR-View-2023-02-21-12-49-33.gif
 
Upvote 0
Back
Top Bottom