RealDocs

UActorComponent::AsyncPhysicsTickComponent

function Engine Since unknown
#include "Components/ActorComponent.h"
Access: public Specifiers: virtual

Description

Override to implement custom logic executed every physics sub-step on the physics thread. Only executes if the component is registered and bAsyncPhysicsTick is set to true.

Caveats & Gotchas

  • This runs on the physics thread, not the game thread. Accessing game-thread-only objects (UActorComponent members, AActor pointers) without proper synchronization will cause race conditions.
  • bAsyncPhysicsTick must be explicitly set to true on the component for this function to be called. It is false by default, unlike PrimaryComponentTick which just needs bCanEverTick.

Signature

virtual void AsyncPhysicsTickComponent(float DeltaTime, float SimTime)

Parameters

Name Type Description Default
DeltaTime float The simulation step size in seconds associated with each physics sub-step.
SimTime float The total elapsed simulation time in seconds since the physics simulation began.

Return Type

void

Example

Physics-thread sub-step update C++
// Constructor
UMyPhysicsComponent::UMyPhysicsComponent()
{
    bAsyncPhysicsTick = true;
}

void UMyPhysicsComponent::AsyncPhysicsTickComponent(float DeltaTime, float SimTime)
{
    // WARNING: physics thread — only access physics-safe data
    PhysicsBodyHandle.AddForce(FVector(0, 0, 100.0f * DeltaTime));
}

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.