Annabell Posted December 18, 2019 Share Posted December 18, 2019 I would like to know if there is a method how to get all possible actions of the controllers (HTC vive Pro Eye) in a unity application programmatically in C#. Do you know any method how to do so? Link to comment Share on other sites More sharing options...
HackPerception Posted December 19, 2019 Share Posted December 19, 2019 @Annabell Can you elaborate more? I'm not sure I follow based on SteamVR's technology. The "action" is defined by the developer and then mapped to a physical input either via the default binding configuration or a user-generated binding file https://valvesoftware.github.io/steamvr_unity_plugin/tutorials/SteamVR-Input.html.The controller input remaps around a-pre defined action - a controller's I/O is heavily customizable by the end user but only to the extent that it can work within the actions defined within the integration of the SteamVR/OpenVR plugin/SDK. I.E. you can remap a system button to report itself as any other input but it won't do anything unless there is an action in place for that input to map to. Here's a video tutorial: Link to comment Share on other sites More sharing options...
Annabell Posted December 20, 2019 Author Share Posted December 20, 2019 @VibrantNebula Yes exactly the developer has to define Actions and match them to one or multiple buttons. You can then trigger those actions, but only when you exactly know what those actions are. For example in Unity it is possible to get all exisiting gameObjects via "UnityEngine.Object.FindObjectsOfType<GameObject>();". So you do not have to tell the code which gameobjects you have. With actions I only figured out that you have to know the names of each action to trigger them, but I did not find a solution how to find out those actions and their corresponding names via a function. @chengnay @zzy @Jad @Corvus Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted December 31, 2019 Share Posted December 31, 2019 @Annabell By looking into SteamVR Plugin, there is a function(FindExistingActionForPartialPath) in SteamVR_Action.cs. Probably you could write your own custom function that will give you actions by using names. EDIT: I found a way that you could get a full list of actions SteamVR_Input.actions <-- will return full array of SteamVR_Action foreach(var action in SteamVR_Input.actions) { Debug.Log("action: " + action.fullPath); } 1 Link to comment Share on other sites More sharing options...
Annabell Posted January 6, 2020 Author Share Posted January 6, 2020 Thanks. works for me 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now