Why the default pawn of the template is spawning?

I’m using the template “2DSideScroller”.

I’ve created a player controller which contains this lines :

60508-playercontroller.png

I’ve created a character which inherits from “2DSideScroller”; I’ve only replaced the flipbook with the red square.

I’ve created a game mode configured as following :

I’ve added two of “BP_Character” to my level :

If I don’t posses one of my red friend, the default pawn is spawn when I hit the button “Play” :

If i possess my character, when I hit played, it’s replaced with the default pawn :

If I change the pawn I controll, my second character is also replaced.

How can I stop this ?

Because you don’t add your player blueprint into the world.

you add a player start.

Then you need to choose the correct default “player pawn” in your project settings.

I find the solution.

The problem wasn’t the player start or the “Player pawn” (in my game mode config, the player pawn is “BP_Character”.

The problem was coming from the event “Update Animation” of my blueprints super class.
If you look into the template class, you have this :

And If I add a simple call to “Event Update Animation” in my “BP_Character”, the flipbook is no longer replaced.

60705-solution.png

To expand on this for other potential users, I ran into a similar issue when spawning a pawn.

I was trying to spawn the pawn in C++ also spawns a “DefaultPawn” as a sphere.
I also tried to spawn the pawn in Blueprints, but it also spawned a “DefaultPawn” as a sphere.

The solution was setting the DefaultPawn to NULL.
I set it in the GameMode constructor by using "this->DefaultPawnClass = NULL;

I had also set the default pawn to my pawn class in BeginPlay(), but the engine must spawn the Default Pawn before the BeginPlay() method is hit. So setting it to NULL in the constructor fixed my issue.

Hope this contributes and helps someone in the future. :slight_smile:

Great, thanks.

Thanks! It helped!