hi~ everyone.
i made a custom class derived by UObject. and the class has a event.
source code is here
MyObject.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "MyObject.generated.h"
/**
*
*/
UCLASS(BlueprintType, Blueprintable)
class GENESIS_API UMyObject : public UObject
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, meta = (DisplayName = "OnTestEvent"), Category = "MyObject")
void OnTestEvent();
UFUNCTION(BlueprintCallable, meta = (HidePin = "WorldContextObject", DefaultToSelf = "WorldContextObject", DisplayName = "Create MyObject"), Category = "MyObject")
static UMyObject* Create(UObject* WorldContextObject);
};
and MyObject.cpp is here
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyObject.h"
UMyObject* UMyObject::Create(UObject* WorldContextObject)
{
UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject);
UMyObject* MyObject = NewObject<UMyObject>();
return MyObject;
}
complie is ok. so i made a blueprint based on the class like this
and then made script in the blueprint like this.
the question is, how can i call this event in my widget blueprint?
i appreciate any of your advice.