AActor::CanEverTick
#include "GameFramework/Actor.h"
Access: public
Specifiers: inlineconst
Description
Returns true if this actor's primary tick function is allowed to tick. This is a convenience accessor for PrimaryActorTick.bCanEverTick.
Caveats & Gotchas
- • CanEverTick() returns true only if PrimaryActorTick.bCanEverTick was set to true before tick functions were registered (typically in the constructor). Setting it to true after the actor has already been registered has no effect until the tick function is re-registered.
- • Returning true from CanEverTick does not mean the actor is currently ticking — it only means it is allowed to. Use IsActorTickEnabled() to check whether ticking is currently enabled at runtime.
Signature
inline bool CanEverTick() const { return PrimaryActorTick.bCanEverTick; } Return Type
bool Example
Guard tick-dependent logic C++
void AMyActor::BeginPlay()
{
Super::BeginPlay();
if (!CanEverTick())
{
UE_LOG(LogTemp, Warning, TEXT("%s has no tick — ensure PrimaryActorTick.bCanEverTick = true in constructor"), *GetName());
}
} See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?