Hi, everyone
I'm new to game development, and I'm trying to write a kinematic character controller that handles the movement of my character.
I‘m having some problems working on the behaviour when the character hits a wall or other obstacles. My expected behaviour is simply illustrated below:

So when the character moves along the green arrow and hit the wall, it will be redirected to a reflection direction indicated by the red arrow, which is roughly parallel to the wall surface.
With a flat and smooth wall surface, I got the expected behaviour, the problem is whenever the character encounters bumpy surface or arrives at the corner of the wall, the reflection direction results tend to bounce between the surfaces for a short period of time and cause the character to jitter. The unstable reflection directions look something like this:

I'm guessing this kind of problem should be quite common for character movement, not only for walls but for uneven ground as well? So I wonder how the game engines handle this problem, is there any classic solution or smoothing algorithms that can reduce the jittering artefact?
Any tips would be appreciated, many thanks in advance.






