Help with GetWorldTimerManager

I am coming from Unity and have an intermediate understanding of C# but very little of C++. I am going through he Battery Collector tutorial and I am having a problem with the GetWorldTimerManager().SetTimer part. I understand the IWYU concept and I also understand this is more than likely an include I am missing but I cannot figure it out.

First the problem

void ASpawnVolume::BeginPlay()
{
	Super::BeginPlay();
	spawnDelay = FMath::FRandRange(spawnDelayRangeLow, spawnDelayRangeHigh);
	GetWorldTimerManager().SetTimer(spawnTimer, this, &ASpawnVolume::SpawnPickup, spawnDelay, false);

}

Visual Studio says GetWorldTimerManager is an incomplete type. As I understand this is a class that is not fully complied yet so the compiler doesn’t know what to do.

Second my current resolution.
If I throw out IWYU and #include “Engine.h” the error goes away and the project compiles very slowly but it does compile and VS has no error. I don’t like this solution as it is adding a large amount of modules I don’t need. Unreal added IWYU for a reason.

TLDR I need to know what files to include when using GetWorldTimerManager from a class derived from AActor.

Thanks in advance for any support you may offer.

#include “TimerManager.h”

WOW. OK that worked! Thanks… Feel kinda dumb now…

how you know that the function was in the TimerManager header file?i am having trouble finding header file for various function…

If you search for GetWorldTimerManager it in the API docs you will see it’s type FTimerManager. If you click on FTimerManager and scroll to the very bottom, you will see:
Header = Runtime/Engine/Public/TimerManager.h