steamvr_unity_plugin icon indicating copy to clipboard operation
steamvr_unity_plugin copied to clipboard

Can I change the SteamVR Input Action Set grammatically from a c# script?

Open alco6 opened this issue 7 years ago • 1 comments

Hello,

I am using the last version of SteamVR Plugin for Unity. I would like to change my SteamVR Input/ Actions set programatically from C# script.

Is there a way to do so? In all the resources I have found it is done manually from Unity interface.

Please, let me know,

Regards

alco6 avatar Apr 26 '19 16:04 alco6

You can change the ActionSet via code. Check Interactable.cs. There's the following code:

[Tooltip("Activates an action set on attach and deactivates on detach")]
        public SteamVR_ActionSet activateActionSetOnAttach;

And then:

protected virtual void OnAttachedToHand(Hand hand)
{
    if (activateActionSetOnAttach != null)
        activateActionSetOnAttach.Activate(hand.handType);
...

Hope that helps!

derosa avatar May 02 '19 08:05 derosa