How do I set up a custom onClick delegate property?

Hello,

Simple question. How to define custom delegate function and set it to onClicked property of AActor https://docs.unrealengine.com/latest/JPN/API/RuntimeModules/Engine/GameFramework/AActor/OnClicked/index.html from C++ code?

Thanks

OnClicked.AddDynamic(this, &SomeClass::SomeFunction);

First argument is object pointer in which function will be called, 2nd is pointer of a function that will be called in that object, it works the same as Action/Axis Binds.

I just tried this a second ago, didn’t work. But this did.

OnClicked.AddDynamic(this, &AMyCharacter::ClickSelect);

There are some discrepancies between Delegates, Dynamic Delegates, and Multicast Delegates.

EDIT: Looks like you updated your answer.

Sorry yes this anwser was when i didnt know about multicast ^^’

Multicast accepts more then one bind, nom-multicast accept only one and one bind will replace another one. Dynamic i guess mean one that you can bind on runtime.