Controlling 2 pawns with 1 controller

Hello,

I know that this question was already asked twice in the past bit I can’t seem to make it work for me.I want to make a shmup game where a player can move two pawns, one for each analogue stick.I’m trying to make them move with input axis events. This seems to work fine for the first pawn, but the second one I cannot seem to get right.

I tried putting them both in the scene and there would be some weird stuff going on with spawning the camera. I have been able to resolve that by removing the second pawn and instead spawning them in using the first pawn’s playercontroller, but I cannot seem to make it move.

I’m adding a screen shot where it shows the spawn logic for the second pawn (located in the first pawn’s controller) and the movement logic for it (located in the second pawn itself).

There is a function in the movement logic that I have added below as a screenshot

I would really appreciate the help as I honestly don’t know what I’m doing wrong here.

I made it by using 3 pawns.

1st one is a empty pawn which contains camera and possessed by custom PlayerController (PC) class (he is default pawn for my GameMode). This pawn is Flying pawn and he takes middle position between 2 other pawns when they spawned and valid.

When game started (in level), PC spawns another 2 pawns (different class) which have character models, animations, and so on. They have special boolean property I called IsCharacterA. When they spawned, for one of them IsCharacterA set to true, for another one to false. So they like CharacterA and CharacterB.

This two pawns referenced by PC after spawn in variables CharacterA and CharacterB.

In project input settings I have everything split for this 2 pawns. For example, axis event MoveRight by gamepad right stick used for CharacterA, and MoveRight by gamepad left stick used for CharacterB.

Then, in PC, I take main player input by axes and actions and pass it to this 2 characters. So, they have their own movement and actions functions.

This is only short overview of how this is works.

Also you need to process few situations for camera. How camera should behave when:

  • both characters are alive

  • 1st one is dead, 2nd - alive

  • 1st - alive, 2nd - dead

  • both are dead

How to clamp character’s movement to screen, or how camera should behave when one of them, or both outside of screen.

Hello, thanks for responding!

I tried out your answer but it doesn’t seem to work for me. I can get them to spawn, but I cannot get them to move. I’m getting some errors that my two pawns are pending kill? I’ll add some images to hopefully make my problem clear.

][2]

Also I’m still not sure exactly why my own method did not work. If possible I would heavily appreciate it if someone could help me understand so that I can learn from my mistakes.

They must have some controller.

193066-2017-08-03_1330.png

Tried spawning the default controller on one and both and also tried the posses node but I keep getting the same error. It keeps saying that the ShipsBlue and Ships \Orange pawns are pending kill.

Maybe there is something that trying to destroy them? Something in level? KillZ maybe?

There shouldn’t be a kill z since this is an empty level and the ships are close to the origin point (0,0,0). They’re also not getting destroyed or despawned, but the controller still views them as pending kill which is strange.
After looking on the internet and trying different things I’ve finally been able to get it to work.Honestly the way it works doesn’t seem different from your answer or my own method. I think my problem was the order I was spawning things in?
Anyway thank you for your time and your help! I’ll set this to answered.