Set Default Pawn Class

Hoping someone can explain to me what I’m doing wrong - I want to change the default pawn that spawns from my PlayerStart based on the control type a user chooses at the start of the game. I set up a GI with a bool that will control which pawn to set as default based on the control type selected…however, I can’t seem to actually get it to override the GameMode Default Pawn. Here is the setup I have, in the class “Set” the drop down is on the default class I want, but it continues spawning the default class set in the GameMode default - FYI I am doing this change IN the GameMode it’s self, with the thought that if I set it there it’d spawn the right pawn in every map.

One other note - I have the print string in there and both are returning the expected pawn but it’s not actually spawning the correct one.

Also one other note - I was able to do this by doing Spawn Actor at Location in the GI then running a custom function in my GameMode, but my PlayerStart location changes every level and I don’t want to keep track of the level + the PlayerStart location for this, it seems like I should just be able to override the default pawn class.

Hi, the Game Mode’s Begin Play is not happening until after your player has spawned, so it is too late to set it there. I can’t seem to find anything that will fire before the spawn (on the game mode). May need to spawn players initially as spectators and then spawn and posses the correct pawn manually.

I had done similar thing with spawn actor at location, but in Level Blueprint, so you have access to level start and get it’s position.

And “default pawn class” is default by reason, i think, because level has to start with something, and then you change it by your needs.

Character Selection watch this it works as I can spawn any of my 6 characters.

1 Like

Hey everyone, thanks for the responses. I think I have it working now by taking various feedback and adjusting it. What I ended up doing was keeping the code in the GameMode, what I did was at Event Begin Play, I cast to my GI, checked control setting, got current level name, find player start, grabbed the location, then spawned the actor. So far it SEEMS to be working, I haven’t tested on the 2 different platform types, but both seem to be spawning in based on the bool in the GI. If anyone is curious here is the way I set it up.

If I run into any issues as I am testing this out over the new few days, I’ll report back that I broke it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.