I have a move left/right Action that has Axis as its Control Type. It’s binding path is /leftStick/x. I want the player to be able to rebind to either /rightStick/x or /dpad/x, but I am having problems restricting the expected path.
I am using the RebindActionUI script provided with the Rebinding UI sample.
My first try was through excluding /, but this has the issue of letting through dpad/up, dpad/down, dpad/right and dpad/left (as these are not based on the Button Layout).
My second try was through an expected control path of /*/x. The problem now is that it appears that the rebinding operation includes as the first m_IncludePath by default. This makes any restriction applied through an expected control type useless, as anything will match the path.
I suppose I could be approaching this wrong, but I think there must be a more elegant solution that I haven’t thought about.
because I can see as an includePath by default. This means that the rebind will accept ANY Gamepad control that has an Axis Control Type (and because Button extends Axis, this means that in practice, the rebind accepts ANY input from the gamepad), regardless of any further .WithControlsHavingToMatchPath(“”) that I might call.
I see that
rebind.Reset();
clears the default includePaths, but it also gets rid of most of the rebind’s configuration, like the expected control type or even the action and binding it is supposed to address. Is there any way to circumvent this issue?
I suppose I could add a lot of .WithControlsExcluding(“”), but I thought there mightbe a better way. Maybe some way to get rid of the default m_IncludePaths. Thank you for your patience.