Character clipping through wall during death animation


Any suggestions on how to deal with character clipping through walls and other actors during death animation playback?

I tried blending between animation and physics but the outcome is even worse!

yeah… i hate physical animations, but thats pretty much the only way to make it work, otherwise you could skip out on the animation altogether, ragdoll him, and then apply physics to him to make it look like a death animations.

I don’t want to use ragdoll. It’s a retro style game, it would look really odd.

I have a good idea for you.

Shoot a ray trace out in 4 directions from the centre of your character outwards going forward, backward, left and right as far as the height of the character. Have an animation for the character falling backwards, forwards, right and left. When a character dies, check if there is a ray trace that isn’t hitting anything, if it isn’t, then play the animation associated with the ray trace.

You should make the ray traces respond to world static.

A possible error would be that the characters don’t die realistically, like if you shoot them from the front they will fall sideways instead of backwards, but for a retro game, I would see that as giving it a bit of a retro character :slight_smile:

Just make sure that you have an animation for if all the ray traces ar colliding with something.
You can add more ray traces with more animations and more animations for the same ray traces to make it look a little different every time.

That’s an interesting idea! Definitely will consider it.

Have two animations, one where the body falls backwards, the other where the body falls forwards. When the character dies, do a trace in the default direction the body is falling (appears to be forwards in the picture you’ve posted). If an object is detected, play the other animation.
You might need even more than two animations, because the above proposed solution wouldn’t work if the character dies between two walls. Then you’d need left/right animations as well. One of the four ought to cover it.

Also, if you wanted your characters to bounce off of walls you could:
Get the distance between the hit location of the ray trace and the player and have an animation of the character bouncing off of the air after a certain distance. You would only need like one extra animation I bet it would look cool and retro, especially if it’s not entirely accurate.

That sounds like a good idea, however, I would like the character to fall forward and be pushed back if there is a wall in front similar to older games but I can only come up with messy solutions…

When a character dies, simulate physics on the characters capsule and rotate z in the direction of velocity, knock him away and slightly up from whatever killed him. Make animations for falling infinitely and for being knocked back::)))) I’ll assume you know how to use AnimBlueprints for now.

I’m not quite sure what you mean, but it appears as if that can be solved by tracing, too. Trace each frame during the death animation in the direction the body is falling. If something is detected, add movement input in the opposite direction. Trace length should be equal to the distance between the body’s further point (i.e. tip of the head) and the center of the capsule on the last frame of the death animation.
This solution comes to mind if you want to completely avoid physics on the mesh and the capsule.

After trying out different methods I am going to go with linetracing on tick when the character dies to add relative location to the mesh to push him out. Thanks!

You can also use ragdolls for death animations, which have collision.

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.