RealDocs

UCharacterMovementComponent::BeginPlay

function Engine Since 4.0
#include "GameFramework/CharacterMovementComponent.h"
Access: public Specifiers: virtualoverride

Description

Initializes movement-simulation state (such as cached navigation and prediction data) once the component's owning actor has begun play.

Caveats & Gotchas

  • Overriding this without calling Super::BeginPlay() skips initialization the movement simulation relies on (e.g. network prediction data setup), causing subtle movement or replication bugs rather than an obvious crash.
  • Runs after UActorComponent::BeginPlay() and before the first TickComponent() call, so anything that depends on UpdatedComponent/CharacterOwner being fully set up is safe to use here.

Signature

virtual void BeginPlay() override

Return Type

void

Example

Overriding BeginPlay on a movement component subclass C++
void UMyCharacterMovementComponent::BeginPlay()
{
    Super::BeginPlay();
    // Custom per-play initialization here
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.