Ragdoll launches into the air

Hi,

I just tried to implement a ragdoll feature in my game. I mostly used the code from the Shooter Example provided by Unreal. Everything seems to work fine but when the ragdoll is activated, the mesh launches up into the air. I also found some threads about ragdolls launching in the air but this is not occuring when I walk over the mesh but when the ragdoll gets active. Sadly “Impart base Angular Velocity” didn’t do the trick for me here.

My Code:

void ABaseCharacter::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);
	}
}

http://puu.sh/khTDu/0df9b60714.jpg

Could anyone help me out here?

Thanks
~Theo

Does it happen everytime? Is it possible that ragdoll has intercollision? Can you show screenshot from the PHAT ?

Yes it does happen everytime.

http://puu.sh/ki7SM/f5ee065a8a.jpg

Remove this capsule from the root bone.

It collides with the ground.

Ahh… Thank you very much! It worked. Didn’t know about that - could you please explain what this capsule did exactly do to make the character launch?
Thank you :slight_smile:

Thanks Pierdek, I had to remove the capsule from the root bone by selecting and deleting it.