RealDocs

APawn::SetRemoteViewPitch

function Engine Since 4.0
#include "GameFramework/Pawn.h"
Access: public

Description

Stores the pawn's view pitch for replication to remote clients by compressing the degree value into a 16-bit integer. Called automatically by `APlayerController::UpdateRotation`; you rarely need to call this yourself.

Caveats & Gotchas

  • This compresses 360 degrees into a `uint16`, so precision is approximately 0.0055 degrees per step — sufficient for animation but not for exact physics calculations.
  • Only the owning server/controller should call this. Calling it on a client will set the local value but it will be overwritten by the next replication update from the server.

Signature

ENGINE_API void SetRemoteViewPitch(double NewRemoteViewPitch)

Parameters

Name Type Description Default
NewRemoteViewPitch double The pitch in degrees to compress and store for replication.

Return Type

void

Example

Manually set remote pitch for a custom controller C++
void AMyController::UpdateRotation(float DeltaTime)
{
    Super::UpdateRotation(DeltaTime);
    if (APawn* P = GetPawn())
    {
        P->SetRemoteViewPitch(GetControlRotation().Pitch);
    }
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable Parameter changed from float to double; internal storage promoted from uint8 to uint16.

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.