How to stop player from building momentum on walls?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By teamNeecaps

i’m making a 2D Platformer and attempting to make fluent physics for it, and I would like to know how to stop gaining velocity while walking against walls.

at some point, i tried making code to fix this issue, but it was flawed

if is_on_wall() && touched.normal.x < 1.0 && move.y != 0.0:

move.x = touched.normal.x

trying to jump up and move towards one-way/semi-solid tiles stops the x velocity, and thought the solution to this would be making one-way tiles passable through the sides aswell, what do i exactly do?

Is the code setting the speed for the player while the player is on the wall? If so, that can be limited by the clamp() function.

Ertain | 2022-08-27 21:31