Download

Select Different Character HELP

Hi guys, i am new here. i am trying to make an game, everything is going ok, but i got stuck with player characters or controllers or idk im confused now…
I use thirdperson game example and change the name of Thirdpersoncharacter to Player1 when i put it in level and move mouse over it its say thirdperson not player1
and i did make 5 copies of my player1 BP character so i want ppl to be able to select one of em and start level1 map as selected… when i do that whatever i select i start with the thirdperson pawn, not the selected one Bp

My english is bad and mby not understabled but hope someone understand what i’m trying to say and help me out thanks alot it advance

I messed a bit with this for my project, it can be tricky. And you’ll have to check your solution in a baked build to be sure it works.

Here is what I did, but there is plenty of ways to achieve things, remember :

  • In the select menu (when choosing character) I set the DefaultPawn in GameMode. Ie: When user click on character.
    -I send a variable of type PawnClass in GameInstance (for persistence) which is the character choosen.
    -On level load, I SpawnActorOfClass (PawnClass). I grab PawnClass from the variable I created in GameInstance.

It works for me.

Silik1 is right. You need to use a GameInstance for this to work. GameModes, Controllers, Characters, and everything else is basically destroyed when you switch between your levels. So any variables set outside the GameInstance will be destroyed. The only other good option, but unnecessary, would be to use a game save.