Guys when i try to run this game in the editor it simply crashes. Crashlog indicates this code right here is responsible.
I’m trying to bind another object to this delegate, so when i call broadcast it will activate that method. Any clues?
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FSubMovementDelegate);
UCLASS()
class BATTLESUBS_API ABattleSubsGameMode : public AGameMode
{
UPROPERTY(BlueprintAssignable, Category = "Test")
FSubMovementDelegate SubMovementDelegate;
};
void ABattleSubsGameMode::Setup()
{
//Bind Submarine Movement to a Delegate.
//Iterate over each controller.
for (auto Controller : Players)
{
if (Controller->GetControlledSubmarine())
{
SubMovementDelegate.AddDynamic(Controller->GetControlledSubmarine(), &ABaseSubmarine::MoveSubmarine);
}
}
}