Hello there guys,
I’m having some troubles with ragdolling in a multiplayer session.
When I apply the following code in my gamemode cpp, only the server session ragdolls the players who should be ragdolled, the client doesn’t seem to apply the code.
for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
APlayerController* PlayerController = *Iterator;
if (PlayerController)
{
ASurvivalCharacter * pPlayer = Cast<ASurvivalCharacter>(PlayerController->GetPawn());
if (pPlayer && !pPlayer->IsPendingKill())
{
pPlayer->GetMesh()->SetAllBodiesSimulatePhysics(true); // doesn't apply on client
pPlayer->GetMesh()->SetSimulatePhysics(true); // doesn't apply on client
pPlayer->GetMesh()->WakeAllRigidBodies(); // doesn't apply on client
PlayerController->UnPossess(); // Is applied
}
}
}
Is there something I’m missing?
Do I need to replicate the functions I’ve called?
Example Image: