UButton Function async / MultThread

I created a class inherited from UUserWidget and inside the OnFindClicked function I want to run an algorithm that changes some materials but async, I tried so many different ways with FNonAbandonableTask, FRunnable, etc… how can I make it work ?
or is it impossible?

UCLASS()
class MYPATH_API UFindWidget : public UUserWidget
{
GENERATED_BODY()

public:
UPROPERTY(meta = (BindWidget))
class UButton* FindButton;

protected:
UFUNCTION()
void OnFindClicked();
};

// -----

void UFindWidget::OnFindClicked()
{
FMyWorker* MyRunnable = new FMyWorker();
FRunnableThread* MyThread = FRunnableThread::Create(MyRunnable, TEXT(“MyThread”));

// Wait for the thread to finish
MyThread->WaitForCompletion();

GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Work Done ")));

}

have you tried with editor tick?
set target alpha
finterp or lerp current to alpha
could use a material parameter collection or something simpler

@SyswareGames

Did that help? Editor ticking should help solve your problem. If not, can you provide more details/context on the problem you’re trying solve ( use case description )

[UE4 / UE5] Question about async loading - #4 by Kris