Download

How to add my events to BPEditior->Details->Events ?

Hi, how can I add my own events to the BP Editor’s “Details” tab - under the Events section.

I know I can make them available in “Browse” from the Event Graph.

RealityInteraction is a USceneComponent that attaches a USphereComponent. When the sphere is collided, I want to trigger a custom event. I’d like that event to be obvious to designers, and to better understand UE4 as a tool.

Specifically how can I add a function/callback/event to the RealityInteraction component, so the function appears on that list.

Thank you!

I’m looking at this, but don’t fully understand it: https://answers.unrealengine.com/que…nt-events.html

Which part you don’t understand. It’s just dynamic multicast delegates (https://docs.unrealengine.com/en-US/…tes/index.html). Check Actor.h for some examples.

Take this example, where I created 2 events in a scene component: one without parameters and another with one (a float):




#pragma once

#include "CoreMinimal.h"
#include "Components/SceneComponent.h"
#include "MySceneComponent.generated.h"

**DECLARE_DYNAMIC_MULTICAST_DELEGATE(FSomeEventSignature);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FSomeOtherEventSignature, float, someparam);**


UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class FPCPP_API UMySceneComponent : public USceneComponent
{
GENERATED_BODY()

public:
// Sets default values for this component's properties
UMySceneComponent();

protected:
// Called when the game starts
virtual void BeginPlay() override;

public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

**UPROPERTY(BlueprintAssignable, Category = "qwe")
FSomeEventSignature OnXXX;

UPROPERTY(BlueprintAssignable, Category = "qwe")
FSomeOtherEventSignature OnYYY;**

};


Triggering them from code:



OnXXX.Broadcast();
OnYYY.Broadcast(100.f);


In BP:

](filedata/fetch?id=1797475&d=1596651278) ​

Hi EvilCleric, thanks for your reply. “It’s just dynamic multicast delegates” Yes. The macro creates an object with .Broadcast(). I fiddled my code till it worked.

Why does declaring a multicast delegate add it to the editor UI there? I don’t understand the Editor’s UI design. Are there any gotchas or limitations?

Thanks!