How could I switch between characters using blueprints when a key is pressed?

Hi.

I am trying to figure out how to switch between characters using blueprints when I press a key. I have read various different posts and noone has really answered the question definitively. I know I need to use a possess and unpossess setup in my player controller but I cannot for the life of me figure it out.

I pieced this together from another post (I know its wrong), and it switches to what seems to be the spectator camera, but I want it to cycle through characters who spawn at the start of the level. Think league of legends if you controlled all 5 characters…

So I have to ask, can someone show me in detail how I can do this? I’m really stuck at this point and would appreciate it more than you know.

Thanks!

Isnt “Get Player Pawn” will return nothing if you unposses or if 1 is 2nd player does not exist or doea not posses anying? Also i thing you dont need to unposses, just posses another pawn and it will switch to new one

Hey ,

Assuming you store all of your pawns that you would want to possess in an array, here is a setup that should cycle through them in order and loops back to the beginning:

Hope that helps!

Hey ,

Thanks a million for that. I really appreciate it. Now I just need to figure out how to store pawns in an array and I will update this with a step by step tutorial for future reference, in case anyone else needs to know how.

Cheers!

Thanks bud :wink:

I’ve managed to create a set up to be able to possess a pawn on overlap, but I cannot figure how to reverse what I’ve done. I set the events on the pawn to be possessed and it works just fine.

However, what I want to do is leave 30 seconds (so I put in a timer) and then have the playercontroller possess the original character pawn, which I had hidden as part of the original script (I didn’t want to delete it as I didn’t know how to recreate it again).

Can you post a screenshot of your setup by any chance? Every time I try to edit my actor array and add my pawn blueprints (My character and MyCharacter2) it is telling me this blueprint cannot be edited. I cannot add references to the pawns either. Stumbling around in the dark here…

Here are a couple of setups you could use based on if you are spawning your Pawns at runtime or if you have them already placed in your level–either one of these would get them into an Array:

Thanks so much . You are a lifesaver! :wink:

Hi.

I am also struggling with this. Was the above done using level blueprints?
I am trying to achieve this without using level blueprints.

do i have to create pawn array and index in all of my character blueprints ??
and how to add character in pawn array its empty?

Will this set up work to be able to switch between a character controller and a pawn? I’m trying to make a third person character change to a ball at button press and from ball back to third person character.

Hello
I am trying the same this and no tutorial is clear enough. Basically what i want to do is:

  • i have 3 different characters in my level. A human a bird and animal
  • the game mode is attached to the level and is defaulted to the human character
  • the other two are already placed in the level
  • i would like to switch between these characters either pressing a key or on overlap.
  • i used 's blue prints on my level blue print but no luck
    Could someone help?
    Thanks

Possessing Pawns in Blueprint - is what you’re looking for.

unfortunately the link does not work