@@ -1094,7 +1094,8 @@ void UPBPlayerMovement::CalcVelocity(float DeltaTime, float Friction, bool bFlui
10941094
10951095 // Do not update velocity when using root motion or when SimulatedProxy -
10961096 // SimulatedProxy are repped their Velocity
1097- if (!HasValidData () || HasAnimRootMotion () || DeltaTime < MIN_TICK_TIME || (CharacterOwner && CharacterOwner->Role == ROLE_SimulatedProxy))
1097+ if (!HasValidData () || HasAnimRootMotion () || DeltaTime < MIN_TICK_TIME ||
1098+ (CharacterOwner && CharacterOwner->GetLocalRole () == ROLE_SimulatedProxy && !bWasSimulatingRootMotion))
10981099 {
10991100 return ;
11001101 }
@@ -1278,7 +1279,7 @@ void UPBPlayerMovement::DoCrouchResize(float TargetTime, float DeltaTime, bool b
12781279
12791280 auto DefaultCharacter = CharacterOwner->GetClass ()->GetDefaultObject <ACharacter>();
12801281
1281- if (bClientSimulation && CharacterOwner->Role == ROLE_SimulatedProxy)
1282+ if (bClientSimulation && CharacterOwner->GetLocalRole () == ROLE_SimulatedProxy)
12821283 {
12831284 // restore collision size before crouching
12841285 CharacterCapsule->SetCapsuleSize (DefaultCharacter->GetCapsuleComponent ()->GetUnscaledCapsuleRadius (),
@@ -1336,7 +1337,7 @@ void UPBPlayerMovement::DoCrouchResize(float TargetTime, float DeltaTime, bool b
13361337 CharacterOwner->OnStartCrouch (HalfHeightAdjust, ScaledHalfHeightAdjust);
13371338
13381339 // Don't smooth this change in mesh position
1339- if (bClientSimulation && CharacterOwner->Role == ROLE_SimulatedProxy)
1340+ if (bClientSimulation && CharacterOwner->GetLocalRole () == ROLE_SimulatedProxy)
13401341 {
13411342 FNetworkPredictionData_Client_Character* ClientData = GetPredictionData_Client_Character ();
13421343 if (ClientData && !FMath::IsNearlyZero (ClientData->MeshTranslationOffset .Z ))
@@ -1525,7 +1526,7 @@ void UPBPlayerMovement::DoUnCrouchResize(float TargetTime, float DeltaTime, bool
15251526 CharacterOwner->OnEndCrouch (HalfHeightAdjust, ScaledHalfHeightAdjust);
15261527
15271528 // Don't smooth this change in mesh position
1528- if (bClientSimulation && CharacterOwner->Role == ROLE_SimulatedProxy)
1529+ if (bClientSimulation && CharacterOwner->GetLocalRole () == ROLE_SimulatedProxy)
15291530 {
15301531 FNetworkPredictionData_Client_Character* ClientData = GetPredictionData_Client_Character ();
15311532 if (ClientData && !FMath::IsNearlyZero (ClientData->MeshTranslationOffset .Z ))
0 commit comments