Unbind event with Create Event?

Is it’s a good idea to use unbind event with CreateEvent node? I see lack of documentation about event dispatchers and especially about unbinding.

In this article used CustomEvent which seems more straightforward in the case of unbinding.
Event Dispatchers explained - Finally !

Is Create Event creates the same event for the same function every call? Or there will be 2 different events and unbind will try to remove binding of nonexistent event?

Is different Create Event create the same event (they can be in different functions)?

As I can understand both cases must have the same behaviour (because CreateEvent node is function call and it can’t store information between calls, so it doesn’t matter whether the same or different nodes is called).

Also, if Create Event actually creates something not cached then there must be two different events and first one will not be unbinded in that case.

I just want to clarify behaviour of unbinding events created with Create Event.

3 Likes

I quickly looked into the source code and saw that the node is actually called “CreateDelegate” and only the display name is “Create Event”. I’m not 100% sure, but it seems that the node is just a container for a function name, signature, scoped class, etc. So when the Bind Event and Unbind Event nodes are executed, they probably check their delegate input connection and read the function name, signature, scoped class, etc. So, bottomline, I would guess that the “Create Event” nodes can be connected to delegate pins just like the normal event nodes and have the desired effect. But I’m unfortunately not 100% sure.

EDIT: I’ve just found "Create Event" node - Blueprint Visual Scripting - Unreal Engine Forums where it says that this node is used to bind functions to dispatchers, and not events.

3 Likes

Yes, it looks like Create Event returns the same “event” for the same function of the same object.

As for tests, function TestFunction called only once in this code.

So as I see, unbinding events created with Create Event should work well.

3 Likes