Laboratory One Research Blog

Unreal Engine C++ Notes

February 20, 2020

This was writting for Unreal Engine 4.23.0

Creating events

There are several types of events that can be created. Let’s look at some.

BlueprintImplementableEvent

As an event

// SomeActor.h
UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "Some Display Name"))
void SomeFunction(const FString& arg1);

Call it with:

// SomeActor.cpp
void SomeOtherFunction() {
    SomeFunction("Test")
}

In the UE4 editor, create a subclass of SomeActor. In this new subclass’s blueprint, you can override the SomeFunction event.

As an function

// SomeActor.h
UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "Some Display Name"))
void SomeFunction(FString& arg1);

Call it with:

// SomeActor.cpp
void SomeOtherFunction() {
    SomeFunction("Test")
}

In the UE4 editor, create a subclass of SomeActor. In this new subclass’s blueprint, you can override the SomeFunction function.


Peter Chau

Written by Peter Chau, a Canadian Software Engineer building AIs, APIs, UIs, and robots.

peter@labone.tech

laboratoryone

laboratory_one