Hello, im trying to do an automatic tooltip system where you give the action and it splits interaction, button, action name, and considers if using controller or keyboard to give something similar to “Hold LeftShoulder to aim”.
I wanted to do this system globally (that processes any binding you can put in the InputAction), but for the UI control scheme, as im using the Cancel [any], and Submit[any], the best i can get for those is the path “*/{Cancel}”.
What im trying to achieve is to get for example in Cancel button: for Switch gamepad (Button South), For Playstation and Xbox controllers (Button East).
I can get this behaviour if I put the desired button to be canceled, but in that case the switch and xbox cancel wouldn’t be different, and i wanted to keep that “automatic” behaviour.
Actually what i have to get the binding name and translate it to “button south” instead of “X” is
InputControlPath.ToHumanReadableString(currentActionMap.action.bindings[currentActionMap.action.GetBindingIndexForControl(currentActionMap.action.controls[0])].effectivePath, InputControlPath.HumanReadableStringOptions.OmitDevice);
worth mentioning: i dont know if its a bug, but using left click for a binding gives index -1 in GetBindingIndexForControl().
I tried different combinations and methods to try get a string for the active controller that matched what im searching for but it either was empty, or it was the path mentioned above ( “*/{Cancel}” )
EDIT: about the index -1, it seems that it occurs in more scenarios, not only in left click. As i was writting the info about this problem I tought it hadn’t anything to do with repeated bindings, but it seems it does.
Lets say the Gameplay layer is first and the UI layer is second. If an action qith the binding in Q is set for both, the second in order will get index -1…
I will investigate a little bit more about this. Seems weird to me because im passing the action, the controller, the index… The system shouldnt be confused to such point it thinks there’s no binding to that action.