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 swap out character pawn blueprints

Hi!

I'm currently developing a game where you play as a person that can transform into different shapes. I have both a blueprint and pawn controller for every single shape and I basically want to swap them out when pressing left & right shoulder trigger on the controller.

The tutorial about possessing pawns on the unreal site requires you to have your blueprints dragged into the level, and then you just swap out those level actors in the level blueprint. I was wondering if I can 1) do this elsewhere like in a 'master controller' that constantly checks this no matter which level you're in and 2) when I possess a different shape, I want the player to transform into the different shapes on the exact location and rotation it is currently in. Additionally, I also want 3) this setup to allow combo attacks to be carried over in between different shapes in the future.

In other words, I wants some sort of functionality like my image below, only I don't know what to plug in to the "target" or if this even can work. Any tips or other suggested blueprint nodes would be helpful!

alt text

Thanks a lot for the help <3

This is the UE4 tutorial I am talking about: https://docs.unrealengine.com/en-US/Gameplay/HowTo/PossessPawns/Blueprints

Product Version: UE 4.21
Tags:
more ▼

asked Jan 19 '19 at 01:14 PM in Blueprint Scripting

avatar image

Azyra_
1 1 1

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

the target for the posses will always be a player controller, and the in pawn will be the pawn your looking to posses. it seems like your looking to become a different pawn entirely according to your explanation, this is actually quite easy you just need to spawn actor of class then plug that into the posses node. as for spawning it in the exact location and rotation of the current pawn thats pretty simple to since you have to specify where to spawn the new one. you just set the spawn location to the players current location. this can all be done in one place so no need for a master controller or the level bp. as for the combo attack well you just have to have a script for that before you destroy the old pawn.

alt text

capture.png (278.2 kB)
more ▼

answered Jan 19 '19 at 04:37 PM

avatar image

ThompsonN13
10k 33 8 23

avatar image Azyra_ Jan 19 '19 at 09:04 PM

Thank you ThompsonN13 for your answer, this actually makes a lot of sense! You are correct, I want to swap out the pawn entirely. I tried it out in my player controller (I'm guessing I'll only be using 1 then for all shapes), but it doesn't let me connect the SpawnActor to the "in pawn" of the Possess as you can see in the image below.

alt text

I'm still quite new to the Unreal Engine, so it's probably something small I'm missing here. Thanks anyways for the help so far!

avatar image ThompsonN13 Jan 19 '19 at 10:25 PM

the issue your having is that the class input that your using is not specified to the pawn level so to speak. if you look at the picture i posted, on the right in the details panel you will see the properties of the variable i created, note that the variable type is pawn class reference. since i specified the variable type the spawn knows that anything it spawns will be a pawn or something inheriting from pawn. long story short change your variable type to pawn. you may also need to disconnect the get from everything (var and spawn nodes) while changing the variable type, sometimes when changing variable type the nodes its connected to dont update correctly.

avatar image Azyra_ Jan 19 '19 at 11:25 PM

It works now! Thank you so much for the help and quick replies <3

(comments are locked)
10|2000 characters needed characters left
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