RealDocs

UActorComponent::AddTickPrerequisiteComponent

function Engine Blueprint Since 4.0
#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 component has completed its tick for the frame.

Caveats & Gotchas

  • The prerequisite must be in the same or earlier tick group for the dependency to be meaningful — cross-group prerequisites have no ordering effect.
  • Avoid adding a component to its own prerequisite chain — circular dependencies are not detected and will cause undefined behavior.
  • The dependency is tracked by pointer; if the prerequisite component is destroyed, stale pointers can cause crashes unless the dependency is explicitly removed first.

Signature

ENGINE_API virtual void AddTickPrerequisiteComponent(UActorComponent* PrerequisiteComponent);

Parameters

Name Type Description Default
PrerequisiteComponent UActorComponent* The component whose tick must complete before this component ticks.

Return Type

void

Example

Make an IK component tick after the skeleton component C++
void UIKComponent::SetupDependencies(USkeletalMeshComponent* Skeleton)
{
	if (Skeleton)
	{
		AddTickPrerequisiteComponent(Skeleton);
	}
}

Tags

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.