I’ve reached the step of editing the files MyProjectGameModeBase.h and MyProjectGameModeBase.cpp. The tutorial says: ‘When you set up your Basic Code project in the previous step, Unreal Engine created a Game Mode for you. Game Modes define a game’s rules and win conditions.’
However my project did not come with either file and I can’t find any similar issues whilst trying to google why they’re not there.
I’d try creating a new GameModeBase file but all the guides say to create a blueprint version of it, not sure if that’s what I want as I’m not using blueprints?
You can create a new cpp file GameModeBase from your editor, set the appropriate variable from VS inside your .cpp and finally from your world setting in the editor set your game mode.
Create New C++ Class menu option
Choose GameModeBase as its base class
Implement it in C++
Build and reload this class
Open up your World Settings (or Project Default settings) and configure the GameMode for the World (map) or Project to be your new class.
MyProjectGameModeBase.h and MyProjectGameModeBase.cpp will only get automatically created if you created a C++ project. You probably made a Blueprint Project, that’s why they’re missing.
You can just manually add them. In the editor, on the top left, click Tools → Create new C++ class → select Game Mode as the parent class, name it and create. You can then set this game mode to be used either in Project Settings → Maps and Modes or in the World Settings of any Level.
Ok I feel pretty foolish, I didn’t realise you could scroll when selecting a base class
That’s worked a treat! Thanks for both of your help.
I definitely made a C++ Project, I had to install VS for it. I also tried creating a few projects but no luck with any of them. So no clue what was going on with that.