Animation to Ragdoll: Character blinks for 1 or more frames

When a character dies, I play the death animation to about the halfway point, and then blend to ragdoll.

It works well for the most part, but there is 1 or more frames in there where the character blinks.

I think the character is going to the reference pose for 1 frame.

It happens every time, on any skeletal model with any animation that I blend to ragdoll.

Anyone seen this and has anyone found a solution?

Hi ,

I shot some video of the Shooter Game in action and could not detect any flickering when transitioning from animated to ragdoll. Can you send me a mostly empty project with a sample of how you have this set up? You can send a dropbox or google drive link to me in a private message on our .

Thanks,

.

Done. Sent. Thank you.

Hi ,

Thank you for sending precise repro steps as well as video clips and images of when the flickering occurs. With that information, I was able to reproduce the issue and have entered the following bug report: JIRA [UE-27876]. When this is resolved we will notify you with an update to this post.

Cheers,

.

This issue has been verified fixed for UE 4.13. Let me know if you have any questions or need further assistance with this issue.

Yeah not fixed. I don’t know who verified it fixed, but I have the same issue still.

Hi , I’ve got the same problem. I do have 4.13 though. Is there another workaround for this issue?

The original issue had 2 parts:

First, the timer to set Rag Doll after the montage was set up incorrectly (Fixed in UE-27876). Second, the Death montage blended out, so the character would pop back to his initial position before enabling Rag Doll, which triggered a flip-flop for one frame. (Fixed in UE-28053).

When testing the last issue, I saw very minor popping as the animation transitioned from programmed animation to ragdoll but a great improvement on the original reported issue.

Do you not find this to be the case?

I would say that it is around 15% less noticeable in the latest build, but still ever present. In my game, we make use of time dilation and it is much more noticeable there as well.

Something to note - I did some actor recording in sequencer last week. I noticed that upon right when the ragdoll occurs, the recorded animation of the capsule seems to freak out for a frame or two. It rotates the character in some crazy ways real quick and snaps it back to where it should be. (This visually appears to be a flip-flop, like the second fix you described…) The skeleton does not reset it’s pose though, it transitions to the ragdoll okay from what I saw, but follows the capsule as it jitters. Leads me to think that perhaps this could solely have to do with the capsule now?? Last night I tried detaching the mesh from the capsule before rag dolling, but that didn’t help.

My game is very near completion and this bug, while not bad enough to stop us from releasing, is a bit discouraging since we make use of lots of ragdoll and time dilation! Also I have to say, I did not notice it in 4.8 or before. Upon upgrading from 4.8 to 4.12, it became apparent. So if something was changed in relation to the capsule or ragdoll sometime between those releases, that could also help us to narrow down the issue even more.

I have reopened this bug report which you can track as UE-28053.

Hello,

When testing against our samples in house, the issue had to do with blend times not being set properly upon setting the character to ragdoll. Basically, if you’re playing a montage and try to blend out what can happen is that even after you put your pawn into ragdoll the blend will still try to force it back to whatever pose you’re blending too.

However, since your simulating now, it doesn’t just cause the position to be reset but also adds forces. Therefore you need to have BlendPhysics enabled before the blending actually starts.

The reason this is potentially more noticeable with time dilation is that the forces applied may get scaled due to that dilation and have more drastic effects.

So, this is really more of a content bug that takes some tweaking to get around.

In our sample Shooter Game, these were the following changes that were made:

void AShooterCharacter::OnDeath(...)
{
    // Other code

    // Death anim
    float DeathAnimDuration = PlayAnimMontage(DeathAnim);

    // Ragdoll
    if (DeathAnimDuration > 0.f)
    {
        // Trigger ragdoll a little before the animation early so the character doesn't
        // blend back to its normal position.
        const float TriggerRagdollTime = DeathAnimDuration - 0.1f;

        // Enable blend physics so the bones are properly blending against the montage.
        GetMesh()->bBlendPhysics = true;

        // Use a local timer handle as we don't need to store it for later but we don't need to look for something to clear
        FTimerHandle TimerHandle;
        GetWorldTimerManager().SetTimer(TimerHandle, this, &AShooterCharacter::SetRagdollPhysics, FMath::Max(0.1f, TriggerRagdollTime), false);
    }
    else
    {
        SetRagdollPhysics();
    }
    
    // More code
}

void AShooterCharacter::SetRagdollPhysics()
{
	bool bInRagdoll = false;

	if (IsPendingKill())
	{
		bInRagdoll = false;
	}
	else if (!GetMesh() || !GetMesh()->GetPhysicsAsset())
	{
		bInRagdoll = false;
	}
	else
	{
		// initialize physics/etc
		GetMesh()->SetAllBodiesSimulatePhysics(true);
		GetMesh()->SetSimulatePhysics(true);
		GetMesh()->WakeAllRigidBodies();
		GetMesh()->bBlendPhysics = true;

		bInRagdoll = true;
	}

	GetCharacterMovement()->StopMovementImmediately();
	GetCharacterMovement()->DisableMovement();
	GetCharacterMovement()->SetComponentTickEnabled(false);

	if (!bInRagdoll)
	{
		// hide and set short lifespan
		TurnOff();
		SetActorHiddenInGame(true);
		SetLifeSpan(1.0f);
	}
	else
	{
		SetLifeSpan(10.0f);
	}
}

There was a still slight pop that we noticed (the characters arm would subtly jerk), but this largely fixed the incident we saw (where the character would flip, and sometimes move away).

I’d recommend taking a look at the above changes to see if there’s any “tunging” that can help. We will continue to look into the jerking issue.

Thanks,
N.

Yeah its fixed for me with the addition of “GetMesh()->bBlendPhysics = true” before setting the timer. Thanks for the clarification

I think this has fixed it for me, too. In blueprint, I just grabbed the mesh of my character on begin play, and set physics blend enabled!

2024 and same issue.
Thanks for “set physics blend” tip !
I still find it strange that the function is not directly accessible to the mesh details. And that it is not activated by default…

This is ancient stuff.
Unless you are on an ancient engine you are barking up a very wrong tree.

Back in 4.20/22 it was already possible to activate ragdoll by switching profiles via the physical animations component.

Never had any blending issues when doing any of that.

This problem has just reappeared so, I am on 5.5.1. I have the problem when my character goes from a simple animation to an animBP (and ragdoll at the same time), also I use a modular character that I merge, and which spawns. So many parameters that could cause problems. In the meantime for the moment everything works.