October 2016
Intermediate to advanced
452 pages
9h 47m
English
Multi-cast delegates are a great way to broadcast an event to multiple objects who listen or subscribe to the event in question. They are particularly invaluable if you have a C++ module that generates events that potentially arbitrary Actors might want to be notified about. This recipe shows you how to create a multi-cast delegate in C++ that can notify a group of other Actors during runtime.
StaticMeshActor class called King. Add the following to the class header:DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnKingDeathSignature, AKing*, DeadKing);
UFUNCTION to the class:UFUNCTION(BlueprintCallable, Category = King) void Die();
Read now
Unlock full access