Hello,
I’ve been transforming my blueprint implemented game prototype to a strict C++ implementation because of several important reasons.
But I am confused about how I could implement Unreal events in C++ with calls to latent methods like Delay()…
From what I understand Functions and Events are very different concepts in Unreal.
Events are basically threads which does not have a return value and can execute latent functions like delay.
Functions on the other hand does not fork like events and continue executing on the main thread of the caller.
This I’ve figured out… However I am really confused about how to implement events which can call latent functions like delay not on Blueprint editor but on C++ side…
I have the below two questions:
-
The UFUNCTION() macro has two relevant specifiers called BlueprintNativeEvent and BlueprintImplementableEvent. First one lets us give an implementation of the method in C++. The second lets the blueprints do it. I’ve noticed that you could assign return values to the methods you define with these specifiers on C++ side. But then the names become misleading. They both have the “Event” in the specifier name though they can be used to write functions. Can BlueprintNativeEvent and BlueprintImplementable event be used to implement Events but not Functions? Are there any additional specifiers to mark a method as an event/thread but not a function? Can I for instance call a latent method inside a method which has the BlueprintNativeEvent property? Can they act as threads in some way? Do they automatically become events/threads if I dont specify a return type?
-
I’ve also noticed that there is the Event type delegate mechanism, in which you can specify a delegate to an event.
To implement Events strictly on C++ which one is the correct way to go?
I am totally confused about this issue and I will appreciate any help I could get.