steamvr_unity_plugin
steamvr_unity_plugin copied to clipboard
Can I change the SteamVR Input Action Set grammatically from a c# script?
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
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!