Tick is never being called even though CanEverTick and StartWithTickEnables is true

Hi all. I have been having this incredibly annoying issue where it seems that my tick for an actor is never called. I have a function called within the tick that is never triggered and a print statement in there also which never prints saying the tick is being called. I’ve been searching online for days and everyone says to enable CanEverTick and StartWithTickEnabled but nothing seems to be working with my project. I have even created a new project and tryed just printing out a line and it doesn’t even work in there either. If anyone has any ideas or has a method of checking to see if something has finished every frame that would be amazing!

Thanks in advance

Louis ,

2 Likes

Are you trying to make the actor tick in game or editor?

In game when I run the game. Not getting any prints to the screen or anything when I run the game that are called in the tick.

Can you post your header file and source?

Unfortunately my internet is down ( Having to use mobile ATM ) so not able to send full source but I have taken some photos of the code. Please find the link attacked to them :slight_smile: Imgur: The magic of the Internet

I did try attaching the images direct to the page but it keeps erroring when I press accept in the image.

Maybe try changing float DeltaTime to float DeltaSeconds in source file? Other than that everything seems to be good.

This didn’t work unfortunately. Like I say I have tried even using a different project and the same issue occurs so not sure what exactly is causing it not to run.

Same here. Just converted an old prototype to 4.12 and my custom C++ pawn’s tick method is never reached. Tried

	PrimaryActorTick.bCanEverTick = true;
	PrimaryActorTick.bStartWithTickEnabled = true;

but nothing. Pawn works fine otherwise, gets input and my movement methods are being called. I have a BP inheriting from this C++ pawn and on that i have set “Start with Tick Enabled” as well.

Not sure if this a bug? Although if it’s been there since 4.11, surely people would have noticed long ago.

So I tried a Tick node in the BP and that doesn’t work either. What does one have to do these days to get there actors ticking?

Still now work around yet!! Really need a work around for this as its stopping me from do anything that i need to do!!
Does anyone know any other way to have a function called every frame? PLEASE

The above link doesn’t work anymore. Can you share the code? Normally those two calls is all you need (along with the declaration “virtual void Tick( float DeltaSeconds ) override;”). Is it a spawned actor or a placed actor? As a long shot, you can try deleting the actor from the level and placing him there again, then run it and see if it works.

Yeah no worries the code i am using to call the tick function are below

Constructor

ATerrainActor::ATerrainActor()
{
	PrimaryActorTick.bCanEverTick = true;
	PrimaryActorTick.bStartWithTickEnabled = true;
	PrimaryActorTick.bAllowTickOnDedicatedServer = true;

	Mesh = CreateDefaultSubobject<UProceduralMeshComponent>(TEXT("Terrain Mesh"));
}

Tick Function its self:

void ATerrainActor::Tick( float DeltaSeconds)
{
Super::Tick( DeltaSeconds );

FString floatval = FString::SanitizeFloat(DeltaSeconds);
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, *floatval);

GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, TEXT("Ticking"));

}

Just fixed it for my project. Turns out “Allow Tick Before Begin Play” was the culprit. In my BP derived from my custom C++ pawn I had to set that to true or else neither BP nor C++ would ever tick.

A bug or by design? I don’t really get what sense it makes to tick before BeginPlay, but then to have it result in not ticking at all unless set to true is another level of strange.

1 Like

If you’re using a blueprint which derives from this actor, did you check the BP “Class Defaults”->“Actor Tick” section? The BP has its own checkboxes for “Start with Tick Enabled”, “Allow Tick on Dedicated Server”, and “Allow Tick Before Begin Play”; make sure they’re all checked.

If you’re overriding BeginPlay, make sure you put Super::BeginPlay() in you’re overridden BeginPlay() function. Also do the same for Tick(DeltaSeconds) with Super::Tick(DeltaSeconds).

It fixed my actor not ticking for me inexplicably.

6 Likes

Your reply helped!

Thanks, brandelan and everyone here.

Geez, I’m an idiot, if I had to cut off a finger for every time not calling Super has wasted an hour of my time I would not have anymore fingers, thanks for the obvious!

I just had the same issue, but everything mentioned above checked.

In my case, my Blueprint subclass, the one that is actually being spawned in the world, had its tick disabled in BP. Worth checking if you’re googling this.

Solved my problem, In my case I was calling super for every other function BUT begin play. Once I added that, the Tick stated working.