When the player presses an arrow key I want my character to move in the right direction.
To do so I use: msg.post("#collisionobject", “apply_force”,…)
How do I stop the character when the button is released?
I’ve tried to accumulate the total force applied and canceling it, but it doesn’t really work when the character collides with something.
It can be done with friction or damping. Disabling and enabling the collision object might reset forces as well (you have to try, I might remember wrong).
However, in our experience it is much better to work with a kinematic collision object for player characters. You will need to solve collisions yourself, which takes a few lines of code, but you will have full control and can move the object as you wish.