i’m just starting to use UE4, so i’m using the documentation tutorials to get started.
Right now, i set the default game mode to use my “MyPongGameMode”, and this works because i print some debug stuff on screen when StartPlay(); gets called.
After that i created a new character class, “MyPongCharacter”, added some debug stuff in BeginPlay(); and set it as default pawn in my “MyPongGameMode” but i can’t see the debug message.
So it’s seems like my character class isn’t used at all, but i did exactly what is written in the documentation…
So you are using C++. Is your game networked? What is your debug code? The GameMode only exists on the server, so depending on your setup your character is spawned on the server and debug code may in fact be running but not in a way visible to the client.
It appears you are doing everything right in your GameMode. If there are any GetDefaultPawnClass() getters, you may need to override them, but it is unlikely.
It sounds like all you need to do is set your MyPongGameMode to the default game mode on your map and, depending on how you want things, In your DefaultEngine.ini. Both of these things can be achieved in editor rather simply. To edite DefaultEngine.ini through a visual interface go to Edit->ProjectSettings then under Project go to Maps & Modes then set Default Game Mode. Under the hood this will write to your DefaultEngine.ini just as though you input the values by hand.
Changing the map value is similar in that it can be done from editor but different and deals with overriding the AWorldSettings class values which can be different for every map in your project. If they are not immediately accessible under your World Outliner, double click your World in World Outliner to bring them up. it should look like this.