Acceleration?
Is it possible to add acceleration to the controller? Friction works well for getting the correct deceleration when adjusted with max acceleration, but there's no way to separately control the acceleration speed for fine tuning. What would be the best way of adding it to the controller?
Currently, you can change the acceleration, but the acceleration and deceleration will always be the same. If I understand correctly, you want the acceleration and deceleration of the controller to be different?
One way to add this would be to make the friction change depending on whether or not you are holding left or right. For example, if you want the controller to accelerate faster than it decelerates, you could make the friction 5 when the player is not holding left or right, and 20 when they are holding left or right. In this case, your acceleration will be fairly quick, but as soon as you release the move key, you will decelerate slowly as if you are on ice.
Currently, you can change the acceleration, but the acceleration and deceleration will always be the same. If I understand correctly, you want the acceleration and deceleration of the controller to be different?
One way to add this would be to make the friction change depending on whether or not you are holding left or right. For example, if you want the controller to accelerate faster than it decelerates, you could make the friction 5 when the player is not holding left or right, and 20 when they are holding left or right. In this case, your acceleration will be fairly quick, but as soon as you release the move key, you will decelerate slowly as if you are on ice.
Thanks, I'll try that, might take a bit of changing things around but that seems like the easiest approach!
Okay, good luck and don't hesitate to ask for help if you get stuck! I implemented variable jump height in a similar way (by changing gravity depending on whether or not you are holding the jump key), so if you don't know where to start you could look at the apply_gravity_multipliers_to function for inspiration.
Okay, good luck and don't hesitate to ask for help if you get stuck! I implemented variable jump height in a similar way (by changing gravity depending on whether or not you are holding the jump key), so if you don't know where to start you could look at the
apply_gravity_multipliers_tofunction for inspiration.
Thanks, I'll check that out!