pleas check this code and tell me what do i wrong.(reference added)

Hi, im a 3D artist and I self-study C++ in the past few months.

I want to run my EQS from C++ and use multi-threads method for this one, I search solution for multi-threads on google but every one of them was for the stuff like as some function need heavy looping or something like that (at least I think that), I couldn’t find a solution for running engine functions or events through the multi-threads, recently with looking in UE4 codes I notice there is a class name UAITask_RunEQS for doing what I want it seems running EQS with multi-threads but I don’t know why QueryResult was protected so I create a class and inherit it from UAITask so i can access to QueryResult, but no matter what I do I cant run the event, please see what part I doing wrong.

I provide a reference :

this code :



i call RunEQS(AAIController* Controller, UEnvQuery* QueryTemplate) with static and none-static ( in source code is static ) version but none of them activated Task event.
from what I understand with calling RunEQS() the event must work and call Activate() function and its give QueryResult, but with no matter I did I couldn’t run it only way I could get querry result was with changing RunEQS() Function :


It gives me QuerryResult but not from multi-threads.

I found this note about Activate() function in GamePlayeTask but I don’t know it useful or not :

pleas help so i can use this code to run EQS through Multi-threads.

Thanks for your time .