The Enemy don't spawn on the world

I did that nothing in the output, copied the code, saved in VS, i had enter the UN4 project hit Compile and started to play! Still no enemy on the map!

In what function are you doing that code? the prints are written in the viewport, not on the output log.

void AFPSShooterGameMode::Tick(float DeltaTime) here is written the code, nothing is desplayed on vieport there is one more pic obove

Ok so as a test put this code at the beginning of the Tick:

GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("TEST!"));

Can you take a screenshot that shows all of the tick function? Or just do a pastebin.

void AFPSShooterGameMode::Tick(float DeltaTime)
{
	GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("TEST!"));
	Super::Tick(DeltaTime);

	GameTimer += DeltaTime;
	EnemyTimer -= DeltaTime;

	if (EnemyTimer <= 0.0f)
	{
		float difficultyPercentage = FMath::Min(GameTimer / TIME_TO_MINIMUM_INTERVAL, 1.0f);

		EnemyTimer = MAXIMUM_INTERVAL - (MAXIMUM_INTERVAL - MINIMUM_INTERVAL) * difficultyPercentage;

		UWorld* World = GetWorld();

		if (World)
		{
			float distance = 800.0f;
			float randomAngle = FMath::RandRange(0.0f, 360.0f);

			FVector playerLocation = GetWorld()->GetFirstPlayerController()->GetPawn()->GetActorLocation();

			FVector enemyLocation = playerLocation;

			enemyLocation.X += FMath::Cos(randomAngle * 3.14f / 180.0f) * distance;
			enemyLocation.Y += FMath::Sin(randomAngle * 3.14f / 180.0f) * distance;
			enemyLocation.Z = 210.0f;

			AEnemyController* enemy = World->SpawnActor<AEnemyController>(
				EnemyBlueprint, enemyLocation, FRotator::ZeroRotator);
			if (EnemyBlueprint == nullptr)
				GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("NULL Enemy Blueprint!"));

			if (enemy == nullptr)
				GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("NULL Enemy Instance!"));

			enemy->Direction = (playerLocation - enemyLocation).GetSafeNormal();
		}
	}

}

Now try it the game and see if it prints TEST! constantly.

I put the picture when playing the game… but nothing is displayed

Ok, on the project settings, are you using this custom game mode as the default game mode? Can you take a screenshot of those settings?

In your custom game mode constructor, add this:

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

and see if it ticks now.

Holy ■■■■ it Worked! I would like to apologies for wasting your time with me and I really give u a big TY for helping me! God bless You xlar8or

It Worked! TY!!!

Good to know :slight_smile: Please mark the answer as correct and if you found my answers helpful, please upvote them :slight_smile: