First you need to have world instance to access timer manager. You can get it from MyPawn.
Next you need to delere timer handle (FTimerHandle), without it you won’t be bale to control the timer after you start it. You can declere it in class, but if you don’t plan to control timer you can declere it locally.
Then you call SetTimer from Timer Manager, first parameter is handle you gonna use, 2nd is object on which function will be called, 3rd is a function pointer to function you want to call when time will be up, 4th amount time, 5th if timer should loop.
But I get an error C2248: 'UBehaviorTreeComponent::UBehaviorTreeComponent': cannot access private member declared in class 'UBehaviorTreeComponent'. and OwnerComp has the red squiggly lines under it.
Could you show an example of calling FinishLatentTask() in Beefy so I could see the setup?
Thats because because it’s a reference, try sending pointer with &OwnerComp if it still complasins it’s private then you need public varable in class (which need to be pointer too)
Make sure that OwnerComp whatever it is is not gets deleted in 4.0s, otherwise you will end up with invalid pointer and sure crash. in worse scenerion you will need to use IsValidLowLevel