Casting a game instance failed ( from multiplayer tutorial video)

Hi, I am following along the Multiplayer video tutorial. One of the steps require casting to a custom Blueprint called GameInfoInstance from the Level Blueprint :

However the cast failed. I’ve checked the GameInfoInstance Blueprint, the parent class is GameInstance;

127850-gameinfoinstancebpdetails.png

now I am stumped. Anyone able to help out ? Thanks.

OK solved it. I needed to go to Edit>>Project Settings>>Maps & Modes >> Game Instance Class and set that to my custom GameInfoInstance. I thought I already did that but somehow it switched back to default GameInstance.

Anyway, its fixed. : )

If anyone care to explain why if we don’t set the Game Instance Class to GameInfoInstance, the casting done in the level blueprint will fail ? It would be appreciated a well. Thanks

I believe what happens is when the game runs and the game instance is not set to be your custom game instance class (GameInfoInstance) the game instead uses the default game instance class in unreal. This means that it can not be casted to GameInfoInstance because GameInfoInstance is a child of the default game instance class and not the other way around :slight_smile: