October 2016
Intermediate to advanced
452 pages
9h 47m
English
Delegates allow us to call a function without knowing which function is assigned. They are a safer version of a raw function pointer. This recipe shows you how to associate a UFUNCTION to a delegate so that it is called when the delegate is executed.
Ensure you've followed the previous recipe in order to create a TriggerVolume class.
GameMode header, declare the delegate with the following macro, just before the class declaration:
DECLARE_DELEGATE(FStandardDelegateSignature)
UCLASS()
class UE4COOKBOOK_API AUE4CookbookGameMode : public AGameModeFStandardDelegateSignature MyStandardDelegate;
Actor class called DelegateListener ...Read now
Unlock full access