I’ve been searching, going through old topics and trying different solutions for this for the entire day.
How can I make a ragdoll go back to being animated and attached to the player?
Closest I have gotten is having the Skeletal Mesh stay unanimated but attached to the player’s legs. I’ve tried tons of different examples.
What am I missing?
void ATDSCharacter::KillPlayer()
{
GetMesh()->SetAllBodiesBelowSimulatePhysics( GetMesh()->GetBoneName(0), true );
GetMesh()->WakeAllRigidBodies();
GetController()->DisableInput( 0 );
Health = 0.0f;
Alive = false;
KillPlayerCB();
}
void ATDSCharacter::SpawnPlayer()
{
this->SetActorLocation(Cast<ATDSPlayerController>(GetController())->respawnPoint);
GetMesh()->PutAllRigidBodiesToSleep();
GetMesh()->SetAllBodiesPhysicsBlendWeight(0.0f);
GetMesh()->SetSimulatePhysics(false);
GetMesh()->SetAllBodiesBelowSimulatePhysics(GetMesh()->GetBoneName(0), false);
GetController()->EnableInput( 0 );
Health = MaxHealth;
Alive = true;
SpawnPlayerCB();
}