hud initialization fixes

This commit is contained in:
Arnaud Jamin
2023-10-07 01:57:42 -04:00
parent b18e62cd02
commit 3e6288c955
23 changed files with 363 additions and 88 deletions
@@ -305,3 +305,26 @@ bool UCogSampleCharacterMovementComponent::ClientUpdatePositionAfterServerUpdate
return Result;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogSampleCharacterMovementComponent::PossessedBy(AController* NewController)
{
if (NewController != nullptr && NewController->IsPlayerController())
{
bWasAvoidanceEnabled = bUseRVOAvoidance;
SetAvoidanceEnabled(false);
}
else
{
SetAvoidanceEnabled(bWasAvoidanceEnabled);
}
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogSampleCharacterMovementComponent::UnPossessed()
{
//---------------------------------------------------------------------------------------
// Make sure the character doesn't keep his velocity while not controlled anymore.
//---------------------------------------------------------------------------------------
ConsumeInputVector();
}