Hi, recently I’ve been working on a system that would allow the player to swap out one character for another with a touch of a button.
So far I’ve just been trying to focus on switching to one character in particular before expanding into being able to switch to all the other characters.
Player Controller blueprint - Character swapping setup:
I’ve managed to set up the blueprint so that when the character being controlled by the player pushes the right analog stick to the left, the previous actor is destroyed and the new character is spawned in their place. I’ve also managed to accomplish switching my custom camera from following the old character to the new one as well.
However, the one thing I haven’t been able to accomplish is that the newly spawned character won’t respond to any controller input. Not only is the character unable to move but they can’t access the pause menu as well, which would appear to indicate that the Player Controller blueprint isn’t taking control of the new character when they spawn into the level.
I’m not sure why is happening, which is why I need help in figuring out why it isn’t working properly.
I was also wondering if anyone also knows how I can spawn the new character in the exact same location as the old one.
With my current setup, the newly spawned character appears at the start of the level instead of the exact same location as the previously spawned character.
As always, any help whatsoever with either of these issues would be greatly appreciated!
Can anyone please help me out? I honestly have no idea on what I do fix problem myself, not helped out by the fact that I can’t find any tutorials online on subject. There’s tutorials for switching between characters, yes, but not ones for swapping out one character with another & deleting the old one.
Like I said in my initial post, my current setup mostly works; I can successfully switch out one for another with my custom camera blueprint also successfully transferring over to the new character. The only problem is that the Player Controller isn’t possessing the new character, resulting in the new character not responding to any controller input.
Can you post a screenshot of the nodes controlling character input? How is it handled? If you are casting to the first character and connecting that to the Target pin of an Add Movement Input node, for example, then that could be the issue…that the Target pins still reference the first character class and not the second character class.
I still haven’t been to figure out why the newly spawned character isn’t able to receive any input from the player but per Zmtrk’s advice I’ve managed to get the new character to spawn in the same spot as the previous one, as well as getting them to face in the same direction upon spawning.
I’m not quite sure what you’re referring to but most of the input for all the different playable characters is handled via the Player Controller blueprint.
I don’t think the problem lies specifically with the Add Movement Input node as not only does jumping not work which doesn’t use the Add Movement Input node but I can’t Pause/Unpause the game either anymore. For whatever reason, the Player Controller blueprint isn’t possessing the newly spawned character and yet the custom camera blueprint I made will transfer over to the new character.
Although I didn’t know that I didn’t need the Set Actor Tick Enabled node at all until you suggested getting rid of it. I don’t remember why I had that node to begin with besides that it was a remnant of an earlier respawning system that I decided to try and repurpose for the character swapping system.
Anyways, now I can swap out characters without a problem, so I guess all remains to do now is to say thanks to everyone who took the time to help me out with problem.