How can I switch a gamemode default pawn on button click?

Hello!
I don’t know if you can even do this, but I want to switch a gamemode’s default pawn upon clicking a button. I don’t know if you can even do this, but the way I have it currently doesn’t work for some reason. Here it is:


So yeah. If anyone can help me, then please, help. I am fairly bad at blueprints.
Thanks!

It looks ok to me, but is your project using this game mode?

Yes it is, but it is in a different scene, so I want it to work like this:
On the main menu, there is a character select widget. You can press the specific character button and it will make the default pawn class the specific character you chose. When you load the next scene that will have the gamemode on it, it will make the player character the character you chose.

It doesn’t work though.

If you can help, please help.

I think you also need to have nothing in the default pawn class in the project. Is that field empty?

The gamemode probably doesn’t persist between scenes ( I assume you mean levels).
When you load a new level (normal blocking load, I’m not talking level streaming or anything like that), all the variables on most of your objects will go back to their default values.
If you want to save a setting like this, you’ll have to save it somewhere where it will persist. For example, look up Game Instances. This will save a value between levels. When the next level starts, your game mode can query the Game Instance to see which pawn it should set as default.

Ok. I will try that. Thanks!

I set it to empty, and it didn’t work. I will try and do what sonictimm said, and see if that works.