AActor::SetTickGroup
#include "GameFramework/Actor.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Assigns this actor's primary tick function to a specific tick group, controlling when in the frame it runs relative to physics and other systems.
Caveats & Gotchas
- • Changing the tick group at runtime after BeginPlay takes effect on the next frame. Prerequisites from AddTickPrerequisiteActor are only honoured within the same tick group — cross-group prerequisites are silently ignored.
- • TG_DuringPhysics ticks concurrently with the physics simulation on a separate thread; reading or writing physics state from this group without synchronisation is a data race.
- • Components on the same actor retain their own tick groups and are not automatically moved when the actor's group changes.
Signature
void SetTickGroup(ETickingGroup NewTickGroup) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| NewTickGroup | ETickingGroup | The tick group to assign (e.g. TG_PrePhysics, TG_DuringPhysics, TG_PostPhysics, TG_PostUpdateWork). | — |
Return Type
void Example
Move actor tick to post-physics C++
AMyPhysicsFollower::AMyPhysicsFollower()
{
PrimaryActorTick.bCanEverTick = true;
// Read physics results after simulation completes
PrimaryActorTick.TickGroup = TG_PostPhysics;
}
// Or at runtime:
void AMyPhysicsFollower::EnablePostPhysicsTick()
{
SetTickGroup(TG_PostPhysics);
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?