UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a button that when clicked goes to fb.com"
// In the header file (.h) of your UMG Widget UPROPERTY(meta = (BindWidget)) class UButton* FacebookButton; // In the source file (.cpp) of your UMG Widget void UYourWidget::NativeConstruct() { Super::NativeConstruct(); if (FacebookButton) { FacebookButton->OnClicked.AddDynamic(this, &UYourWidget::OpenFacebook); } } void UYourWidget::OpenFacebook() { const FString FacebookURL = TEXT("https://www.fb.com"); FPlatformProcess::LaunchURL(*FacebookURL, nullptr, nullptr); }