How to stop character sliding when walking into something

So my question is a bit hard to explain, but ill try

On the video you can see that the animation walks forward and because of the forward movement it "slides" to the side. The movement comes from the animation with root motion, is there a way to stop this sliding ?

Tera would be a great example of what im trying to achive.

Here each skill moves your character a bit forward but since its hitting a wall it doesnt move forward and it stays in 1 place.

Welll it seems the problem is the capsule collision of the the other actors because it’s a spher it continues to move/slide to the side abuse the the sphere is not an even surface like a wall meaning it will inch forward and the collision avoidance will push the character a little probably the best way to fix this is if your attacks move the character a bit forward you could have a line trace check to see if the character can move forward when attacking with would prevent the sliding on the capsule