Glitch frame when attaching skeletal mesh to capsule

This has been driving me crazy. I am getting a glitch in my animation poses when I try to change the pose and the skeletal mesh transform in the same frame. I’m trying to get a character to stand up from ragdoll, and I followed the excellent training video explaining how to do it with snapshot poses.

However, the process doesn’t work exactly for me, something to do with the fact that before ragdoll, the character is attached via constraint to my player’s hand (I’m throwing him).

But here’s the problem. He’s on the ground in ragdoll, detached from his capsule. I cache a snapshot pose and display that as I go from simulated physics to non-simulated. That works fine. Now I have the animated snapshot pose displayed and I need to reattach the skeletal mesh to his capsule. I would think that could just attach the mesh to the capsule and keep the world position. But there’s a glitch - the animation seems to lag a frame behind or something.

I tried a workaround, by creating a second snapshot pose where take the first pose and transform its bones manually so that it looks the same when attached to the capsule, keeping the relative transform the same as it needs to be for the animations that will follow. Again, the one frame glitch.

It seems like the animation graph is mistakenly not incorporating the transform changes I make in the Event Graph at the same time I am requesting the AnimGraph to switch poses. If there is a blend time greater than zero between the two poses, then it actually goes to the wrongly transformed pose and then slowly blends to the right one. So it seems like the AnimGraph is actually caching this incorrect pose from the first frame.

I’ve tried so many things. Making the skeletal mesh tick follow the component that changes the transforms didn’t work. I tried making a custom animation curve which goes immediately to the final frame – it doesn’t work, it still seems to want to display the very first frame of the animation.

In case I didn’t describe the problem clearly, here it is again. I have a pose which is displaying correctly. But I need to attach my mesh to its capsule, and when I do that, the pose is going to be displayed incorrectly because the transform changes. So I precalculate the correct pose for the new transform, and I tell the AnimGraph to switch to the new pose at the same time I attach the mesh to the capsule. It works, but there’s a glitch because the graph seems to either lag or be ahead of the transform update.

Anyone know what I am talking about or have suggestions on what I can try to fix it?
Thanks!

I have the exact same issue, and I can sympathize 100% with what you were going through. Did you ever find the solution? It seems to me that the snapshot is taking the snapshot pose correctly And then when I reattach to the capsule Collision the rotation changes. Then when you try to reference the snapshot pose in the animation graph, it is rotated so it looks like the character is standing up rather than laying down from the rag doll position when he stopped moving. This is super frustrating.

I did get it to work finally, but it was so long ago I don’t remember many details. I think the main thing was that was not attaching a separate little ‘root’ bone at the feet of my skeleton like they did in the video. And then maybe setting it to Kinematic? If you are looking at the same video that I did, he adds this root bone to the skeleton, and at first I wasn’t doing that or was doing it differently than he did in the video. Seems like it started working after I did that.

Thanks man. I tried and tried everything including the littleroot bone but could not get it to work. I rarely give up, but this one stumped me. I think the main issue is that by the time I take the snapshot pose it is in one orientation, and then you reattach to the capsule and the orientation is changed. Then when you tried to blend from the snapshot posed to the animation it looks as if the character is standing up, when they really were lying down at the time the snapshot pose was taken. I can’t get it to work, so I’m just going to work around it for now and not support that functionality. I hope that epic games can provide some tutorial on how to do this. it seems like a pretty basic capability and I’m a little surprised to find it so difficult to execute in the Unreal Engine which does everything else so well. At times :slight_smile: good luck to you.