Can I lock Y Axis for an anim montage?

I have an animation for the character to do a dodge step forward…but since its a side-scroller…I need him if he hits collision to not slide along the wall if I keep dodge-stepping into the wall…he slides on the collision in the Y axis…anyone have any suggestions?