I don’t usually work on Fridays and today is a holiday over here but I was in the mood to add a new input. It is scary when adding any new control though this one was fairly straightforward. Since the sprinting doesn’t take up any resources I feel the player would be sprinting more often than the normal run. Even I myself get lazy to hold down the sprint key. I had been thinking about adding a toggle button for a while but I thought it would break something.
As long as I am careful and do the right testing, it should all work out. I was able to add a new input that allows the player to toggle sprint instead of holding it down. Also, thanks to my testing the sprint I found another issue. There is a lean on the character when sprinting but if you lean and stop the player stays tilted. I had never noticed this before. The fix was to remove the lean if the player is not moving.
It was easy to implement the sprint toggle which makes me feel good because that means I am getting better at having more efficient functions. I also realized that if the X-axis is inverted the lean is backward. I made sure that the lean/turn amount is negative if the X-axis is inverted.
Then finally I added the new input to the keyboard and controller menus. Placed it below the dash button since they are related. It messed with the symmetry of the buttons but that’s alright.




