void ATimerActor::RepeatingFunction()
{
int i;
for (i = 0; i < 200;)
if (Checking == true)
{
i++;
Checking = false;
GetWorldTimerManager().SetTimer(UnusedHandle, this, &ATimerActor::LoopFunction, false, 1.0f);
//GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Red, FString::Printf(TEXT("I++")));
}
}
void ATimerActor::LoopFunction()
{
GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Red, FString::Printf(TEXT("A location of Actor is: %s")));
newlocation.Z++;
newlocation.Y++;
newlocation.X++;
MyMesh->SetRelativeLocation(newlocation, false, 0, ETeleportType::None);
Checking = true; GetWorld()->GetTimerManager().ClearTimer(UnusedHandle);
}