RealDocs

UActorComponent::PrimaryComponentTick

property Engine Since 4.0
#include "Components/ActorComponent.h"
Access: public Specifiers: UPROPERTYEditDefaultsOnly

Description

The primary tick function for this component. Configure it in the constructor to control whether and how the component ticks.

Caveats & Gotchas

  • You must set PrimaryComponentTick.bCanEverTick = true in the constructor before the component is registered, or TickComponent will never be called — setting it after registration has no effect.
  • Tick prerequisites (AddTickPrerequisiteComponent, AddTickPrerequisiteActor) must be configured before or during registration. Adding prerequisites at runtime after BeginPlay requires re-registration or explicit ordering via the TickTaskManager.

Signature

UPROPERTY(EditDefaultsOnly, Category="ComponentTick")
struct FActorComponentTickFunction PrimaryComponentTick

Example

Enable ticking in the component constructor C++
UMyComponent::UMyComponent()
{
	PrimaryComponentTick.bCanEverTick = true;
	PrimaryComponentTick.bStartWithTickEnabled = true;
	PrimaryComponentTick.TickGroup = TG_PrePhysics;
}

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.