i just replied to that question. why dont they make it do something else? because that’s not what that node is for. if you want that functionality you should implement something else.
for example:
this code is lgpl3-only copyright me
// Copyright (C) 2023 - Jeronimo Barraco-Marmol. All rights reserved.
// SPDX-License-Identifier: LGPL-3.0-only
#pragma once
// excerpt of my own library
#include "CoreMinimal.h"
class UWorld;
class UWidget;
#include "JMiscUtils.generated.h"
DECLARE_DYNAMIC_DELEGATE(FOnJAsync);
DECLARE_DYNAMIC_DELEGATE(FOnJAsyncDone);
// Type of graph to use
UENUM(BlueprintType)
enum class EAsyncExec: uint8
// Engine\\Source\\Runtime\Core\\Public\Async\Async.h:27
// the type used on AsyncTask is much more granular. but unfortunately it´s not BlueprintType and is int32 so it cant be exposed
{
/** Execute in Task Graph (for short running tasks). */
TaskGraph,
/** Execute in Task Graph on the main thread (for short running tasks). */
TaskGraphMainThread,
/** Execute in separate thread if supported (for long running tasks). */
Thread,
/** Execute in separate thread if supported or supported post fork (see FForkProcessHelper::CreateThreadIfForkSafe) (for long running tasks). */
ThreadIfForkSafe,
/** Execute in global queued thread pool. */
ThreadPool,
};
UCLASS(Blueprintable)
class JUTILS_API UJMiscUtils: public UBlueprintFunctionLibrary {
GENERATED_BODY()
public:
// Calls a Task (a Delegate) on another thread, when finishes calls OnDone on the game thread (if bound)
// What Not to Do:
// * Do not try to modify, create, or delete UObjects from other threads!
// * You can prepare all the data / do all the calculations, but only the game thread should be actually spawning / modifying / deleting UObjects / AActors.
// * Dont try to use TimerManager outside of the game thread :)
// * Don´t try to draw debug lines/points etc, as it will likely crash, ie DrawDebugLine(etc...)
UFUNCTION(BlueprintCallable)
static void BPASync(const FOnJAsync& Task, const FOnJAsyncDone& Done, EAsyncExec Exec = EAsyncExec::ThreadPool);
}
/// on the cpp
void UJMiscUtils::BPASync(const FOnJAsync& Task, const FOnJAsyncDone& Done, EAsyncExec Exec) {
// using [Task, Done] instead of & since it's much safer. re-entrant calls could crash otherwise.
Async((EAsyncExecution) Exec, [Task, Done]
{
Task.ExecuteIfBound();
if (Done.IsBound()) {
AsyncTask(ENamedThreads::GameThread, [Done]
{
Done.ExecuteIfBound();
});
}
});
}