UActorComponent::AddTickPrerequisiteActor
#include "Components/ActorComponent.h"
Access: public
Specifiers: ENGINE_APIvirtualUFUNCTIONBlueprintCallable
Description
Adds a dependency so that this component's tick does not run until the specified actor has completed its tick for the frame.
Caveats & Gotchas
- • This adds the dependency on the actor's root component tick, not any particular component of that actor — if you need to depend on a specific component, use AddTickPrerequisiteComponent.
- • Adding circular prerequisites (A depends on B, B depends on A) will cause a deadlock or undefined ordering — the engine does not detect this.
- • Prerequisites only apply within the same tick group. If the prerequisite actor is in a later tick group, the dependency has no practical effect.
Signature
ENGINE_API virtual void AddTickPrerequisiteActor(AActor* PrerequisiteActor); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PrerequisiteActor | AActor* | The actor whose tick must complete before this component ticks. | — |
Return Type
void Example
Ensure a follower component ticks after the target actor C++
void UFollowerComponent::SetTarget(AActor* Target)
{
TargetActor = Target;
if (Target)
{
AddTickPrerequisiteActor(Target);
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?