BP latent / async nodes from a class and triggered by delegate

Hi, I have been messing around with UBlueprintAsyncActionBase and FPendingLatentAction to control the flow execution in BP. Essentially I the node triggers an action and the execution should continue once the action is done.
I use a delegate to know when the action has ended and got it working with UBlueprintAsyncActionBase. The problem is that the node is available from any class, I wan it to be used like a regular function, ONLY on this class.

On the other hand with FPendingLatentAction I get the class only behavior just by adding the latent action in the class function. But I cannot seem able to bind the end with the delegate. I need it to work with the delegate as I need it to return the action state.

FPendingLatentAction .h


		UFUNCTION(BlueprintCallable, Category = "BP", meta = (Latent, LatentInfo = "LatentInfo", HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject"))
			virtual void GetRequest(UObject* WorldContextObject,  struct FLatentActionInfo LatentInfo);

FPendingLatentAction .cpp

void UUnitBehavior::GetRequest(UObject* WorldContextObject, FLatentActionInfo LatentInfo)
{
	// Prepare latent action
	if (UWorld* World = GEngine->GetWorldFromContextObjectChecked(WorldContextObject) )
	{
		FLatentActionManager& LatentActionManager = World->GetLatentActionManager();
		if (LatentActionManager.FindExistingAction<FDelayAction>(LatentInfo.CallbackTarget, LatentInfo.UUID) == NULL)
		{
			LatentActionManager.AddNewAction(LatentInfo.CallbackTarget, LatentInfo.UUID, new FDelayAction( 5.0f, LatentInfo));
				
		}
	}
}

Found the problem. For non UObjects like FPendingLatentAction you need to bind with BindRaw to a nonDynamic delegate. Just save the E

LatentAction .h

FDelegateHandle EndHandler;

LatentAction .cpp

EndHandler = yourObject->OnFinishedTaskDelegate.AddRaw(this, &FYourLatentAction::End);

And the delegate you want to bind, in this case multicast one param

classToBind.h

DECLARE_MULTICAST_DELEGATE_OneParam(FOnFinishedTask, const bool);

PD: Also make sure you dont name your latent action like FDelayAction or some engine existing class. Got my Delay nodes not working ONLY on the build without a single error anywhere :face_exhaling: