Issue: Cannot create BlueprintImplementableEvent with args in UUserWidget. BlueprintImplementableEvent works fine when args are removed.
Reproduction:
Create a new C++ project.
Create a new ‘MyUserWidget’ class below
In the .cpp file, just include the header.
Attempt to compile, fails
Remove FString MyKey argument.
Re-attempt compile, success.
Expected Result: Compiles fine in step 4.
Note: May also be an issue with BlueprintNativeEvent
MyUserWidget.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "Runtime/UMG/Public/Components/VerticalBox.h"
#include "MyUserWidget.generated.h"
/**
*
*/
UCLASS(Blueprintable)
class MYPROJECT_API UMyUserWidget : public UUserWidget
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget))
UVerticalBox* VBox;
UFUNCTION(BlueprintImplementableEvent)
void BUSTER_WOLF(FString MyKey);
};
MyUserWidget.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyUserWidget.h"
The name doesn’t change anything. This is just a stub a made to test. The actual thing had the same results and used normal UE4 UpperCamelCase naming conventions.
In general I don’t think function names have restrictions in UE4 right? Also per the original question, only those two files are needed to reproduce the bug. So I don’t have any macros elsewhere.
I don’t think Events can take input arguments. Doing the same with a function, instead of an event, with UFunction(BlueprintCallable) works fine. Needs implementation in the ,cpp file as well.
I stand corrected, you’re absolutely correct. Should’ve been obvious but I was somehow stuck in thinking in terms of BP and not remembering an input variable pin on any of the standard events, of course the event nodes themselves can have variables coming out of them.
This probably also explains the use of const FString& instead of just FString