Sure. So currently I have two blueprints that control the character’s spawning. I’ve got a custom player controller blueprint and a game mode blueprint.
To spawn a character (one of the two child actors), I’ve made a function (called “Spawn Player Character”), that will loop through an array of the child actors and selects which one to spawn based on a index parameter and where using transform data.
“Spawn Player Character Function” (inside of Custom Game Mode Blueprint):
To swap between players, I use the custom player controller blueprint to find the character in the scene that it’s currently possessing, compare it with the characters in the array (passed through as a reference from the game mode blueprint), and call an interface message to a “Swap Player” function that I’ve implemented back inside the game mode blueprint if the character’s ARE indeed different (also passing through the transform & index data that are needed to spawn in the correct place).
“Character Swap” Action Event (inside of Custom Player Controller):
This “Swap Player” interface function takes the passed through index and transform data and sends it to the “Spawn Player Character” function inside of the game mode blueprint (as seen in first image) that will spawn a new character (might seem like a waste, but it makes sense given what is next).
“Swap Player” Interface Function (inside of Custom Game Mode Blueprint):
“Spawn Player Character” Function (inside of Custom Game Mode Blueprint):
So I do also use the “Spawn Player Character” function at the start of the game when spawning the first character. To put it simply, I first spawn a series of empty pawns to recognise when & where a player should spawn, and carry out the exact same process as before, call an interface message to another interface function called “Spawn Player” (from inside of this empty pawn blueprint), pass through the data needed (index & transform data), and let the “Spawn Player Character” function spawn the character into the scene.
“Spawn Players” Action Event (inside of Empty Pawn Blueprint - to spawn first initial character):
“Spawn Player” Interface Function (inside of Custom Game Mode Blueprint):
“Spawn Player Character” Function (inside of Custom Game Mode Blueprint)
But since this is only responsible for spawning the first character into the game, I’ve got no issues with character rotation / movement, so I don’t believe the problem lies here.
I found that swapping the characters when the player is facing the world’s forward facing direction causes no rotation issues, it just when it’s swapped once the character faces any other direction. All the inputs for movement are now local to the character’s forward facing direction rather than the world’s. That’s the best way I can describe the problem (along with the visual aid I linked in the previous post).
If there’s anything more specific that you want to look at, do let me know, I’ll try my best to find it. Thanks.