RealDocs

UCharacterMovementComponent::UnpackNetworkMovementMode

function Engine Since unknown
#include "GameFramework/CharacterMovementComponent.h"
Access: public Specifiers: virtualENGINE_APIconst

Description

Decodes a movement mode byte produced by PackNetworkMovementMode() back into its base mode, custom sub-mode, and ground mode components.

Caveats & Gotchas

  • Must be paired with an override of PackNetworkMovementMode() from the same class hierarchy — decoding a byte packed by a different packing scheme produces garbage mode values.
  • This only decodes into out-parameters; it doesn't apply the mode to the component. Use ApplyNetworkMovementMode() if you want the decoded values actually set on the character.
  • Called on both server and client during move processing, so a custom override needs to behave identically on both sides or clients will desync their locally predicted movement mode.

Signature

virtual void UnpackNetworkMovementMode(const uint8 ReceivedMode, TEnumAsByte<EMovementMode>& OutMode, uint8& OutCustomMode, TEnumAsByte<EMovementMode>& OutGroundMode) const

Parameters

Name Type Description Default
ReceivedMode const uint8 The packed byte produced by PackNetworkMovementMode() on the sending side.
OutMode TEnumAsByte<EMovementMode>& Receives the decoded base movement mode.
OutCustomMode uint8& Receives the decoded custom movement sub-mode, valid when OutMode is MOVE_Custom.
OutGroundMode TEnumAsByte<EMovementMode>& Receives the decoded ground movement mode to resume after falling.

Return Type

void

Example

Decoding without applying C++
TEnumAsByte<EMovementMode> DecodedMode, DecodedGroundMode;
uint8 DecodedCustomMode;
GetCharacterMovement()->UnpackNetworkMovementMode(PackedByte, DecodedMode, DecodedCustomMode, DecodedGroundMode);
// Inspect DecodedMode/DecodedCustomMode/DecodedGroundMode without mutating the component

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.