To reverse controls drop this code block into whatever class you will have reversing the controls.
make sure you are using InControl; at the top
privateBindingSource[] ActionDownValueP1 =newBindingSource[4];privateBindingSource[] ActionUpValueP1 =newBindingSource[4];privateBindingSource[] ActionRightValueP1 =newBindingSource[4];privateBindingSource[] ActionLeftValueP1 =newBindingSource[4];privatebool HasAlreadyReversedControls =false;publicvoidReverseControlsP1(float AmountOfTimeControlsReversed) {GungeonActions actions =BraveInput.PrimaryPlayerInstance.ActiveActions;var ActionLeft =actions.Left.Bindings;for(int i =0; i <ActionLeft.Count; i++)ActionLeftValueP1[i] =ActionLeft[i];var ActionRight =actions.Right.Bindings;for (int i =0; i <ActionRight.Count; i++)ActionRightValueP1[i] =ActionRight[i];var ActionUp =actions.Up.Bindings;for (int i =0; i <ActionUp.Count; i++)ActionUpValueP1[i] =ActionUp[i];var ActionDown =actions.Down.Bindings;for (int i =0; i <ActionDown.Count; i++)ActionDownValueP1[i] =ActionDown[i];actions.Left.ClearBindings();actions.Up.ClearBindings();actions.Down.ClearBindings();actions.Right.ClearBindings();for (int i =0; i <ActionRightValueP1.Length; i++)actions.Left.AddBinding(ActionRightValueP1[i]);for (int i =0; i <ActionLeftValueP1.Length; i++)actions.Right.AddBinding(ActionLeftValueP1[i]);for (int i =0; i <ActionUpValueP1.Length; i++)actions.Down.AddBinding(ActionUpValueP1[i]);for (int i =0; i <ActionDownValueP1.Length; i++)actions.Up.AddBinding(ActionDownValueP1[i]); HasAlreadyReversedControls =true;GameManager.Instance.StartCoroutine(FixControlsP1(AmountOfTimeControlsReversed)); }privateIEnumeratorFixControlsP1(float SecondsToWait) {yieldreturnnewWaitForSeconds(SecondsToWait);GungeonActions actions =BraveInput.PrimaryPlayerInstance.ActiveActions;actions.Left.ClearBindings();actions.Up.ClearBindings();actions.Down.ClearBindings();actions.Right.ClearBindings();for (int i =0; i <ActionLeftValueP1.Length; i++)actions.Left.AddBinding(ActionLeftValueP1[i]);for (int i =0; i <ActionRightValueP1.Length; i++)actions.Right.AddBinding(ActionRightValueP1[i]);for (int i =0; i <ActionDownValueP1.Length; i++)actions.Down.AddBinding(ActionDownValueP1[i]);for (int i =0; i <ActionUpValueP1.Length; i++)actions.Up.AddBinding(ActionUpValueP1[i]); HasAlreadyReversedControls =false; }
This grabs the current movement bindings and stores them in fields. It then takes what was up, and uses it for down, takes what was down and uses it for up, etc. Now I hear you cry, "But An3s, can't we just use negative movement speed to reverse controls?" No, you're stupid, and I hate you. Setting the value to a negative can lead to all sorts of jank and bugs: 1) touching a wall sticks you to that wall and you cant walk off it. 2) trying to enter a boss room soft locks the game. 3) the running dust particles are a never-ending stream. So it is just better to subtly switch the player binds.
Now things will break terribly if you try to reverse controls while they are already reversed, which is why we have the bool HasReversedControls in there. so whenever you call ReverseControls you make sure HasReversedControlls is equal to false. This code can work with player two with some tweaking, but I leave that up to you if you want it.
to call it simply go: