Character Movement with Collision

Hi,

I have a simple root motion animation here: Screen capture - 51807e317160a65e659fc041fc636ab7 - Gyazo

The problem I am trying to solve is: When I am close to the collision box of the monster, and I play my root motion animation, if my character is not perfectly straight on the collision box, I do the weird sliding to the left or right alongside the surface of the collision box. Here is a gif that portrays what I mean:

In the first skill, I am perfectly aligned with the collision box so I don’t move at all. One the second attempt, I am at an angle so I slide down to the right.

Is there a simple-ish way to stop the sliding from happening, and basically say “If colliding, just don’t even try to move”?

I know that I can possible do a trace test before the skill, and if I hit something close, just use an in-place animation instead of a root motion one. However this only solves the problem for root motion animations, but I want to stop the sliding for regular movement aswell.

Thanks.