Stop GameMode from spawning Pawn and PlayerController on Play

Hello, I am new to unreal engine but have good unity and C++ experience so bear with me.

I have created my own PlayerController blueprint as well as my own Pawn blueprint containing a single Static Mesh component, however whenever i press ‘Play’, a new PlayerController, Pawn and other things are spawned and used instead of my things.

I believe these are being created by the GameMode, so I created my own GameMode too, however there does not seem to be an option to set PlayerControllerClass or Default Pawn Class to ‘none’.

Is there a way to do this? Or is it mandatory by design? If so, why is that?

Hi miracle7,

‘None’ is not an option, but you should have no trouble using the classes of your choosing. In your GameMode Defaults, all you need to do is select the Pawn and Player Controller classes that you want to use, and then in the World Settings, ensure that your GameMode is being used.

I hope this helps

Thank you for that, I guess as a workaround I can make an empty controller and pawn for the game mode to spawn, hopefully that doesn’t have any nasty side effects. If it becomes a problem i will just ask another question, cheers :slight_smile:

override GameMode’s SpawnDefaultPawnFor, return null Actor, then no default pawn spawns.

override GameMode’s SpawnDefaultPawnFor, return null Actor, then no default pawn spawns.

Have you noticed you saved a human life?

That’s me! ( • ̀ω•́ )و☆

This seems to work:

Its worth noting that this caused an issue when trying to respawn the players after death…

Sorry to resurrect an old post, but the most streamlined implementation(That I’ve found) to achieve this goal is override GetDefaultPawnClassForController. Which is called by the engine implementation of SpawnDeafultPawnFor and SpawnDefaultPawnAtTransform.