Why is an extra player object spawning?

When I run my project in the editor it always spawns an additional player object on its own at what seems like a random location (usually up in the air over the map). I’d like it to not do that.

I’m using an unusual method for generating the map, which may be related. I read from an outside file and then spawn in a bunch of actors, including the player character object that I actually want. I’m wondering if it’s spawning the extra player before that because it feels like it needs one.

Regardless, does anyone know if there’s a way that I can disable this behavior?

Yes, that could be related with how you spawn your player manually. GameMode handles spawning of PlayerControllers and Pawns automatically, if you didn’t change it.

I am not sure if this a BP or C++ project, so I can’t really say much more, but here is the a useful documentation article about GameMode that you should read.

Also this one

Not sure what kind of game you are making, but it is usually best to stay within Unreals framework. So I would advice to set up a proper GameMode and let it handle the spawning of PlayerPawn and Controller.

It was the game mode spawning the extra. I changed the default pawn class to none and it stopped doing it. Thank you.

I know I am a bit late to this thread, but I ran into the same issue and for me the solution was different. I spawn my pawns in C++ on the server side. If you do not set the function that spawns the pawns with ‘WithValidate’ it runs also on the client, creating 2 copies of the pawn.

1 Like