How to posses characters or pawns correctly? 2

How to posses characters or pawns correctly?

I’m re-posting this question because it went silent unsolved.

Hello UE4 masters, I need your help. I’m currently working on a project in which a character gets an upgrade that lets him switch shape from A(walker) to B(Ball) kinda like Samus. Now I two blueprints that I found online but both give out different results, I’ll post the pictures.

With this blueprint I can switch from A to B but A remains present on scene and can’t go from B back to A :frowning:

With this blueprint I can switch from A to B at the established location…but when I press c for the second time to switch back from B to A it creates a copy of A nearby and when I press c for a third time it then possesses A but none are destroyed… Also the location there is set because if I connect the get actor location to make transform’s location it spawns B in the middle of nowhere falling to oblivion…so another problem is that I can’t get the transformation to happen in the location that the character is currently at.

Finaly with this blueprint, I believe I’m able to transform shapes back and forward but I’m spawning in the middle of no where or in the exact 0,0,0 but I need the transformation to happen where the player currently is.

Any help would be greatly appreciated.

  • Controllers possess pawns. You probably want to do all the following in your player controller:
  • Get and save the location (or entire transform) of your existing pawn if you want the next pawn to have the same location (or transform)
  • UnPossess the pawn
  • Destroy the pawn
  • Create the new pawn, using the location (or transform) you saved.
  • Possess the new pawn

That seems to work well for me in my project.

Can you upload a screenshot of this because I’m having trouble following.

Alright thank you. I have it set up just like this but when I compile, the get controlled pawn, posses and unpossess give me errors and the need a target. When I try to connect the reference of the character I have it wont let me because it’s “not compatible with controller reference”

Dunno what to do…

Either do it inside your player controller and use “self” as the reference, or get a reference to your player controller and use it as the target in those nodes.

That’s the thing, it is inside my player controller yet I continue having problems.

Here, have a look…

  • What is the type (class) of RollerBot_Walker_Reference?
  • What is the parent class of RollerBot_Walker_BP?

The RollerBot_Walker_Reference type or class is an instance object

The parent class of the RollerBot_Walker_BP is character

This is all wrong… zip up Config, Content folders and the .uproject file and upload it here.

Your code does exactly what you don’t want and there is no code to do what you want to do. It’s too complicated to work out with several screenshots. Zip up the essential files and upload them here. Copy them to another directory to test before you upload. If you can open the project and it works I’ll be able to help.

Any ideas CleanCut?

Sorry, I didn’t see your original reply, for some reason.

Regarding RollerBot_Walker_Reference, I have never heard of an “instance object”. Are you sure it’s not a skeletal mesh or something like that? (Hovering over the variable in your “My Blueprint” pane should tell you the type, like I demonstrate with this Integer:

87329-screen+shot+2016-04-18+at+10.23.44+am.png

Both Get Controlled Pawn and UnPossess need the player controller to be their target. To do that, you should use the Get Player Controller node:

87330-screen+shot+2016-04-18+at+10.26.38+am.png

Sorry for the delay as well.

Hovering over both tells me they are being referenced to their blueprints. I kept tinkering with it and and managed to be able to transform between characters not to the 0,0,0 coordinates but in a random manner… so still not to where the character currently is. It fells like I’m getting close but still a couple of steps away.

D4njo,

Picking up where CleanCut left off, correct me if I’m wrong, but it appears that your RollerBot_Walker_Reference is a reference to your playable character, not it’s character controller (the icon in your variables list does not match that of a player controller derivative type.) The screenshot you posted is also not in a controller blueprint, as evidenced by your error messages regarding the get controlled pawn node requiring a target.

You’ll want to put those above nodes in the actual player controller BP assuming you have one.

After working with the answers provided and digging even more in the interwebs I found a solution that works wonders with what I’m trying to do. I’ll post it to share my finding and just in case anyone else wondered the same thing as me and has trouble making it work.

Thanks all for the replies!