Looking through CharacterMovementComponent.h, the UPROPERTY MovementMode has the following comment:
However, I’m finding that when I try to use SetMovementMode() on my client, the change is not honored. My code from my Character class:
void AReviewerCharacter::ToggleFly()
{
UCharacterMovementComponent* Movement = GetCharacterMovement();
if (Movement)
{
if (Movement->IsFlying())
{
Movement->SetMovementMode(EMovementMode::MOVE_Walking);
}
else
{
Movement->SetMovementMode(EMovementMode::MOVE_Flying);
}
}
}
When my multiplayer game starts, the host begins in flying mode (as I set the movement mode for the character in BeginPlay()), but the connected client begins in walking mode – I’m not entirely sure why this is. If I hit the key that calls the ToggleFly() code above, the code does get executed but the client remains in walking mode. If I do the same thing on the client that is acting as the host, toggling works just fine. Just the connected client remains in walking mode no matter what. Am I missing something? Any help is greatly appreciated.