Jump to content
 

Recommended Posts

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? 

Share this post


Link to post
Share on other sites

@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:

 

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

@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);
}

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...