AActor::Tick

Function called every frame on this Actor.

Windows
MacOS
Linux

Override Hierarchy

Syntax

virtual void Tick
(
    float DeltaSeconds
)

Remarks

Function called every frame on this Actor. Override this function to implement custom logic to be executed every frame. Note that Tick is disabled by default, and you will need to check PrimaryActorTick.bCanEverTick is set to true to enable it.

Parameters

Parameter

Description

DeltaSeconds

Game time elapsed during last frame modified by the time dilation

Example Code

MyActor.cpp at line 6:

AMyActor::AMyActor(const FObjectInitializer& ObjectInitializer)  
{  
    PrimaryActorTick.bCanEverTick = true; //We won't be ticked by default  

    bIsMoving = false;  
    Health = 100.0f;  

    MovementVelocity.Set(0.f, 300.f, 0.f); // How far we want to move in a second  
}  

MyActor.cpp at line 18:

void AMyActor::Tick(float DeltaTime)  
{  
    Super::Tick(DeltaTime); // Call parent class tick function  

    if(bIsMoving == true )  
    {  
        UpdateOffset(DeltaTime);  
    }  

}

References

Module

Engine

Header

Runtime/Engine/Classes/GameFramework/Actor.h

Source

Runtime/Engine/Private/Actor.cpp

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback