Assertion failed: FTickTaskManager::Get().HasTickFunction(Level, this) in 4.5

Hello,

In 4.4 everything works fine but after upgrading my project to 4.5 I get an assertion during calling UWorld::SpawnActor( UClass* Class, const FActorSpawnParameters& SpawnParameters = FActorSpawnParameters()).

Exact error: Assertion failed: FTickTaskManager::Get().HasTickFunction(Level, this) [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.5\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp] [Line: 986]

To be honest I have no idea what could cause that issue :smiley:

EDIT: When I set SpawnParameters.Template to nullptr everything seems to work fine but I really need to use templates :slight_smile:

Hi cloud,

Could you provide the callstack created by the assertion, and the latest log file for your project?

For some reason I cannot attach log file directly so I zipped both files.

link text

Hey cloud-

We’re still investigating this issue but I wanted to ask if you are still receiving the same error in the latest version of the engine? Do you receive the error message when trying to build the project or when running it in the editor or standalone/packaged game?

Cheers

Thank you for the info. In 4.6 there is an error in another place (I tested it in PIE):

    void UActorComponent::InitializeComponent()
    {
    	check(bRegistered);
    	**check(!bHasBeenInitialized);**
    	bHasBeenInitialized = true;
    }

I include whole stack trace in attachment and point to another thread with the same issue: link text

link text

Hey cloud-

Does the crash occur for you in a new project? If so what steps are you taking that cause it to happen so that I can reproduce it on my end. Also, if you could post your log files from when the crash occurred it will help determine what the cause is.

It’s actually super easy to replicate that issue by creating new Top Down template (C++) with starter content. Next step is to add

UFUNCTION(BlueprintCallable, Category = Default)
	AActor* SpawnActor(TSubclassOf<AActor> actorClass, AActor* actorTemplate, FVector position);

to public section in header file of project player controller and

AActor* AMyProject4PlayerController::SpawnActor(TSubclassOf<AActor> actorClass, AActor* actorTemplate, FVector position)
{
	FActorSpawnParameters SpawnInfo;
	SpawnInfo.bNoCollisionFail = true;
	SpawnInfo.Owner = this;
	SpawnInfo.Instigator = nullptr;
	SpawnInfo.bDeferConstruction = false;
	SpawnInfo.Template = actorTemplate;
	auto world = GetWorld();
	auto actor = world->SpawnActor<AActor>(actorClass, SpawnInfo);
	actor->SetActorLocation(position);
	return actor;
}

to source file (of course you have to change the name of the class to correct one for you project). Then you compile and run project in the editor, open MyCharacter blueprint and add some nodes to Begin Play event (check image). When you start the game in PIE you should get the error.

.

I’m aware that this blueprint would run recursively (if it works correctly) but it’s the fastest way to show that issue. You could also create new player controller based on that from C++ and use those two Spawn Actor nodes in Begin Play event of player controller, then create new Game Mode (set default to the new one) and use that GM in World Settings.

I was able to use the code snippet you provided to reproduce a crash though it did not have the same error message. Just as a check, could you test if you are able to use PIE if you comment out or remove the line “actor->SetActorLocation(position);”?

Without that line I get the same error.

Was there anything added to the project other than the code you posted above? Also, could you post a screenshot of the error you’re receiving when you try to use PIE?

There was nothing more added (only that function amd changed MyCharacter blueprint). Instead of screenshot (as editor is instantly closed after exception) I include callstack and log file (this is from version with new game mode as mentioned before).link text

Hey cloud-

I was able to reproduce the issue as you described and have submitted a report to our bug tracking system (UE-7071). As a temporary solution I found that changing “SpawnInfo.bNoCollisionFail” from true to false as well as omitting the line actor->SetActorLocation(position); will not cause the crash to occur.

cheers

This still seems to be happening 4.8.3. I tried setting bNoCollisionFail to false but the assert failure still occurred. Are there any updates to this issue?

Hey -

Could you provide more information on what you’re doing and exactly what error you’re getting? Additionally posting the logs and callstack from your crash will help identify the crash.

Cheers