AActor::AddTickPrerequisiteComponent
#include "GameFramework/Actor.h"
Access: public
Specifiers: virtualUFUNCTIONBlueprintCallable
Description
Forces this actor's tick to run after the specified component's tick has completed. Useful when the actor's logic depends on up-to-date data computed by a specific component.
Caveats & Gotchas
- • Like AddTickPrerequisiteActor, this only applies to the actor's primary tick function, not to its components' tick functions.
- • The prerequisite component must be registered and have ticking enabled; a disabled component tick will not block the actor's tick from firing.
Signature
virtual void AddTickPrerequisiteComponent(UActorComponent* PrerequisiteComponent) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PrerequisiteComponent | UActorComponent* | The component whose tick must complete before this actor ticks. | — |
Return Type
void Example
Wait for physics component before reading bone positions C++
void AMyCharacter::BeginPlay()
{
Super::BeginPlay();
USkeletalMeshComponent* Mesh = GetMesh();
if (Mesh)
{
AddTickPrerequisiteComponent(Mesh);
}
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?