Switch between playable characters/NPCs in Open World

Hi everyone,

I’m currently working on a semi-open world third person RPG game with some friends. I have a few questions about how to go about some certain features.

In the game, there will be different playable characters unlocked as the story progresses. I want these characters, when they are not being used as the playable character, to inhabit different parts of the world as interactable NPCs. The current character that the player is controlling should then be able to walk up to and interact with these characters and switch out with them, and when this happens, the other character should go to where ever they are supposed to in the world, becoming an NPC and giving control to the newly selected character. This would also change how other characters talk to the selected character when interacted with (i.e. referring to them by the characters name, having different kinds of dialogue depending on who they are talking to).

I’m going to be honest and say I have really no clue how to go about this. My friends and I are all pretty new to Unreal Engine 4 and still learning stuff about it, but this is a sort of passion project that we’ve had in concept for a while. I’ve looked at videos of switching characters while in-game, but I’m not sure how to merge that with the character going from being a scripted NPC in the world to a playable character, and vice-versa. Should I have different blueprints, one for the playable version of the character and one for the NPC version? And should I use some sort of global manager that keeps track of the currently selected character and changes the locations/dialogues of other NPCs based on that? Any help would be greatly appreciated, thank you.

short version…you want to be looking at not only switching the character but also, when that switch happens. you also want to assign the controller. So say your current player is A and the NPC to switch to is B…A interacts with B, you choose to switch, possesion node switches possesion from A over to B and at the same time you want to have a nodes to assign A with the AI controller and assign B with the player controller.

First: make sure you REALLY understand the difference between “pawn” and “controller.”
“Character” is a subclass of Pawn, that knows how to move around, given specific movement instructions.
An AI controller (for an NPC) should know how to give a Character instructions.
A player controller (for a player pawn) should know how to give a Character instructions.

So, as long as all your Characters have the same interface on them (might be plain Character, might be some additional subclass you decide) you should be able to drive the same pawn from both kinds of controllers.
Then, when wanting to “swap” with another character, you simply get the controller from the NPC, assign that to your currently controlled pawn, and assign the player controller to the previously-NPC pawn. Done!