Unreal editor v. 5.0.3
I m trying to repeat an asynchronous task like in the example: Multithreading
If I use creating task in BeginPlay:
void AMyAsyncActor::BeginPlay()
{
Super::BeginPlay();
FAsyncTask<FMyTask>* newTask = new FAsyncTask<FMyTask>();
newTask->StartBackgroundTask();
}
it works.
If i try to declare the task as a member of the owner type:
public:
// Sets default values for this actor’s properties
AMyAsyncActor();
FAsyncTask* newTask;
in *.h file i have error:
Error C2065 ‘FMyTask’: undeclared identifier;
Error C2955 ‘FAsyncTask’: use of class template requires template argument list
How to properly declare a new task?