x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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 :( alt text

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. alt text

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. alt text

Any help would be greatly appreciated.

Product Version: UE 4.9
Tags:
more ▼

asked Apr 08 '16 at 04:14 PM in Blueprint Scripting

avatar image

D4njo
6 4 7 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first
  • 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.

more ▼

answered Apr 08 '16 at 07:12 PM

avatar image

CleanCut
2.1k 67 84 77

avatar image D4njo Apr 12 '16 at 08:30 PM

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

avatar image CleanCut Apr 12 '16 at 08:43 PM

alt text

avatar image D4njo Apr 13 '16 at 01:11 AM

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...

avatar image CleanCut Apr 13 '16 at 03:57 AM

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.

avatar image D4njo Apr 13 '16 at 04:23 AM

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

Here, have a look..

alt text

avatar image CleanCut Apr 13 '16 at 04:33 AM
  • What is the type (class) of RollerBot_Walker_Reference?

  • What is the parent class of RollerBot_Walker_BP?

avatar image D4njo Apr 15 '16 at 04:56 PM

The RollerBot_Walker_Reference type or class is an instance object

The parent class of the RollerBot_Walker_BP is character

avatar image D4njo Apr 18 '16 at 03:47 PM

Any ideas CleanCut?

avatar image CleanCut Apr 18 '16 at 04:27 PM

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:

How to discover the type of a variable

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:

alt text

avatar image D4njo May 02 '16 at 04:49 PM

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.

avatar image DesertEagle_PWN May 02 '16 at 05:40 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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.

more ▼

answered Apr 16 '16 at 02:48 AM

avatar image

Nick Jackson
492 17 14 107

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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!

alt text

switch_pawn_2.png (82.7 kB)
more ▼

answered May 03 '16 at 03:39 PM

avatar image

D4njo
6 4 7 10

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question