Incomplete type is not allowed for GetWorld()

For the line
GetWorld()->GetTimerManager().SetTimer(FireRateTimerHandle, this, &APawnTurret::CheckFireCondition, FireRate, true);
GetWorld has a red squiggly with the error “incomplete type is not allowed”.

I’ve tried adding #include "GameFramework/Actor.h" and #include "Engine/World.h" to no avail. Any idea what I’m missing here?

In that statement you’re using the types

UWorld
FTimerManager
FTimerHandle
APawnTurret

You have UWorld and APawnTurret covered so you would need the includes for the other two.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms