Download

AddDynamic from a static class

Where UStaticCoreGameTime is a static class, and ATP_SimGameGameState is a GameState, is there a way to do this:

I’m have this line in the BeginPlay method of the game state class:


 UStaticCoreGameTime::NewMonthNotify.AddDynamic(this, &ATP_SimGameGameState::MonthlyNotifyReceived);

“error C2228: left of ‘.__Internal_AddDynamic’ must have class/struct/union”

What kind of delegate is NewMonthNotify?

AddDynamic only supports certain delegates.

Here is the NewMonthNotify (Part of UStaticCoreGameTime) method:



    // Called at start of new month
    UFUNCTION()
    static void NewMonthNotify();


It’s just an empty function.