Character Transformation (Character Switching)

I am trying to do Character switching between two BP, CharacterA and CharacterB, but every time I press in this case Button Q, I switch characters but always go back to the player start position, it doesn’t remove old actors but keeps adding new ones.

I am a beginner so please be mindful of that, still learning, and trying new things. This setup might look ridiculous but it’s the best I could figure out. I really tried hitting on this for a few days but no solid results.

Issue #1: keeps spawning new actors without removing old
Issue #2: When I switch I go back to Player Start Position

After that I want to add animations and particle so that switching is not so static but I’ll make another post about it if I can’t figure it out after fixing these.

Before destroying, save the actor’s transform value into a transform type variable

Plug the Controlled Pawn into the Destroy Actor node


Oh and also an important note here, handle this in the level blueprint and not inside the character blueprint.

You can open the level BP like this:

Hope these help! :blush:

Like this? Now the old actors don’t appear anymore, one issue is fixed and you came like a blessing.

But switching still brings me back to the player start position, did I do something wrong?

It’s in Player Controller Blueprint

You’d need to save the Player Pawn’s transform instead of the controller’s :innocent:

May your day be blessed for taking time to help me out, for replying, for begin nice, I am new and been strugling on this for a whole week, watched so many tutorials and nothing. Thank you I truly appreciate it.

By the way did I do it right this time, look at the issue that I am facing.

1 Like

Break the transform type variable, also split the Spawn Transform pin by right clicking on it and selecting the Split Struct Pin option, and plug in all the exposed components of the transform type variable except for the Scale one (meaning you should only connect the Location and Rotation values)

What a brilliant solution—that makes perfect sense. The speedy fixes you provide me with have me completely amazed. Let me try this now.

1 Like

One more weird thing that is going on, only if you want, you helped me a lot but if you are willing to help me fix the rest, I am thankful from my heart. I am worried I might offend you from asking so many questions.

The camera is weirdly jumping, cause after these fixes, I am going to add animation enter and exit and particles, cause I want to do something like Transform from a Human to a flying Butterfly. It’s kinda cool. And this camera thing will cause issue for smooth transformation.

Oh sorry I just noticed! I don’t receive notifications on your edits.

Before destroying:

After spawning:

:innocent:

I get this Error this time…

smiling_face

The more errors I get the more stressed I get continuing this. Please at least tell me that I am not annoying you.

Oh I should’ve added that you should not only set the control rotation after spawning the actor, but also after possessing it :rofl:

I shall do my best to return the same value of help to beginner artists as myself, from the help and teaching you have provided me with this time.

It’s working, but it’s like a slideshow of pages. Did I miss something?

@VisAgilis

No :rofl: I didn’t mean placing the node once after spawning and once again after possessing, I meant it’s placement should not only be after spawning but also after possesing, meaning it should just be after possesing and not before that.

But yeah I get the confusion on that sentence :laughing:

My brother, I AM SORRY, that was quite silly of me, my goodness. Sorry… I am so panicked right now

After Fixing the nodes. Looks kind of the same.

At least now it’s error free right? :rofl:

Idk maybe there can be better ways to fix that, but if this is the result of our last approach, maybe you can consider activating another camera for the duration of the transition.

To do that, you’d need to create another actor and add a camera component to it. Rotate it with the control rotation just the way you do for the current camera, just don’t activate it. And after you destroy the actor, activate it by first, casting to it (or you can also use a reference if you set that up on Begin Play) and then using the Set Active node. You can transition back to the camera that’s in the player character’s BP once the possessing is complete.

Though I didn’t expect such an outcome to be honest :thinking:

@VisAgilis I apologize I had to get off and didn’t reply, now it’s late, I will check it out tomorrow and see if I’ll manage to fix it somehow and pm you how it turned out. If we make it work, maybe we can share the setup for some other guys to find it useful. Thanks for the help.

1 Like

Hey @ahkai_1, I wanned to try it out myself and just as I thought, the code should actually work! :star_struck:

Here’s a video showcasing the result:

Maybe there are some other stuff going on in your project. Try creating a new project using the third person template and implementing our code in the level blueprint. Hopefully you can spot the differences that way! :blush:

Yeah I transfered it and it does work, I’l figure something out.

However, anytime I change my character, the particles remain at the player start position, and I receive an error when I add a pawn node. Furthermore, my Play Montage nodes does nothing. I am not sure why; is it necessary for me to add something to the skeletal mesh component?

Attempts have yielded no results thus far. This is probably the final thing I have to do for this setup.

Start simulation > Character A > Exit animationA > Enter animationB > Character B > Particle > Exit animationB > Enter animationA > Particle > CharacterA = (LOOP)

More realistic-looking and fluid transition between two characters and I believe that the setup is essentially finished

I would call it Character Transformation Player Controller. This so far was realized for me, because of your help, thank you. I lack yet fundamental knowledge about blueprints.

@VisAgilis

You should also plug in the saved transform variable’s location component into the Spawn Emitter at Location node’s location pin instead of the actor location.

For anim montages to work, you should plug in the default slot into the main out pose of your anim graph. Open up your animation blueprint, navigate to the anim graph, do not go into any state machines and just stay in the main anim graph. Right click on an empty space, search for “Default Slot” on the menu that pops up, select the "Slot ‘DefaultSlot’ " option to place the slot node, then connect it’s input (Source) pin into an animation or a state machine, and connect it’s output pin into the Out Pose.

Hope this helps! :innocent: