Tick() fires even if PrimaryActorTick.bCanEverTick = false;

Hi thereI am using UE 4.13.2 and I am fallowing the battery collector tutorial from UE. I wanted to disable tick in the game mode just to see whether or not it is possible (which should be). I’ve built and compiled multiple times yet I still get the message “Tick gets called”. Any ideas why is that? Thanks in advance!

void ABatteryCollectorGameMode::BeginPlay()
{
	Super::BeginPlay();

	BCCharacter = Cast<ABatteryCollectorCharacter>(UGameplayStatics::GetPlayerPawn(this, 0));
	PrimaryActorTick.bStartWithTickEnabled = false;
	PrimaryActorTick.bCanEverTick = false;
}

void ABatteryCollectorGameMode::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

	if (BCCharacter)
	{
		// Draw power from the Battery Collector Character
		BCCharacter->AddPower(-BCCharacter->GetInitialPower() * DrawPowerRate * DeltaTime);
		UE_LOG(LogTemp, Warning, TEXT("Tick gets called"))
	}
}

Hey !

Open the blueprint that inherit this class and look at the " Start With Tick Enabled" property, and set it to false.

There was no blueprint for the GameMode class so I created one which helped me fix the problem. I was setting PrimaryActorTick.bCanEverTick = false; in the BeginPlay() instead of the constructor. I thought there would be no difference but apparently you can start ticking before BeginPlay().

Thank you for helping me out !

Oh, didn’t noticed that you were calling it in begin play ! Glad it helped you ! :slight_smile: