"Set Timer by Function Name" doesn't work for me. Following book example. Can't see the difference!

I’m reading “Unreal Engine 4 Game Development in 24 Hours” (where each hour dilates to about 3 hours when I try to do it :smiley: )

On Hour 21, we are meant to use, for the first time, “Set Timer by Function Name”, with the “RestartGame” function on the GameMode. It doesn’t work for me. I tried other methods, like “QuitGame”; nothing works. But I see that the “Set Actor Hidden in Game” works, so I know the OnDeath function gets called. I downloaded the book example, which works; I can’t see the difference! See picture…

[ATTACH=CONFIG]OnDeath[/ATTACH]

Which version of the engine are you using and which version of the engines does the tutorial refer to?

In 4.15 *GetGameMode *returns GameModeBaseReference while the *RestartGame * function requires GameModeReference - have a look at the output log, you should see a warning regarding bad function name.
You may need to cast it first:

If I cast, as Everynone suggest, nothing happens, so I used Print String on cast failed, and output the object class. The cast does fail, with object class “ArcadeShooter_GameMode_C”, which is my game mode. So it seems my game mode cannot be cast to game mode; strange.

And if I don’t cast, the log says (I forgot to look there first before posting; it’s the first time since I started that book where I got stuck, and that “visual programming” is making me forget how to debug) “Warning: SetTimer passed a bad function (RestartGame) or object (ArcadeShooter_GameMode_C_0)”, so it looks to me like both the function name and the object are correct.

… later …]

When I look at the ArcadeShooter_GameMode Blueprint, it says: “Parent Class: GameModeBase” ; that seems to be the problem. Changing the base class fixed the issue.

I can confirm changing the GameModeBase parent class to GameMode still works. I spent way more time on this then I should have. It appears most tutorials need the original GameMode.

From my understanding GameMode is now a subclass of GameModeBase that handles loading/reloading the levels?