Character clipping through wall during death animation

Old question but it might be useful to someone.

Use rootmotion, set you animation so the torso/head is in the same axis that the rootbone, you will do this in your blender equivalent software, then move the root so the feet stay at the same place. In ue4 you set the animation to use root bone animation, once it is all set correctly, when your animation plays, if your character is facing the wall, the feet will slide back, since the capsule cant move forward due to the wall, and if your character is against the wall, the feet stay in place, and the capsule will move forward. Samething if you do a death animation falling to the back.