Hi! I’m quite new to UE, I’m trying to write my own Actor that exposes functionality via Blueprint. The thing is that when I use UFunction, I get the expected behavior for BlueprintCallable
and BlueprintPure
, but with the events, I can’t get them to show up in the editor, I don’t know if I’m missing something. Here is the code:
I’m using UE 5.2.1
AATestActor.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "ATestActor.generated.h"
/**
*
*/
UCLASS()
class TEST5_2_API AATestActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AATestActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
public:
UFUNCTION(BlueprintImplementableEvent, Category="Test5_2")
void OnBPImpEvent(FString& Output);
UFUNCTION(BlueprintNativeEvent, Category="Test5_2")
void OnBPNativeEvent(FString& Output);
UFUNCTION(BlueprintCallable, Category="Test5_2")
void BPCallable();
UFUNCTION(BlueprintPure, Category="Test5_2")
bool BPPure();
};
CPP
#include "ATestActor.h"
// Sets default values
AATestActor::AATestActor()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AATestActor::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AATestActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void UTestBlueprintFunctionLibrary::OnBPNativeEvent_Implementation(FString& Output)
{
}
void UTestBlueprintFunctionLibrary::BPCallable()
{
}
bool UTestBlueprintFunctionLibrary::BPPure()
{
return false;
}
Editor (Events not showing up)