Slowing down the character slide when moving against walls

I’m trying to slow down the back and forth sliding of a character when they are pressing against a wall so that slide isn’t so noticable. They should mostly be staying still when they are pushing against a wall, but at the same time they shouldn’t have difficulty stepping away from it.

Any ideas about how I would achieve this?

Hi!
I would try two options:

  1. Use line trace to detect wall and then block movement input in trace direction.
  2. Use IK to define last step position.

I’ve never done this before so this is just a thoughts.