Local Multiplayer mobile movement

Hi!

I’m trying to develop a 1 to 4 local multiplayer game for android, and when it comes to movement I have some questions:

I’ve been looking into UMG and into touch interface and what I would like is to have 1 joystick per player that will allow them to move. But I’m not sure if this is possible because:

  1. Touch interface only seems to support up to 2 joysticks, and you can’t load more than one touch interface as far as I’m aware.

  2. I can’t see a way to tell the touch interface what it should do. I want this joystick to move THIS PLAYER CONTROLLER.

  3. UMG doesn’t seem to have AXIS support ?

What is the right way to approach this?

Thanks!

Hi, have you solved this problem?
I Have the same problem. I am also trying to develop a multiplayer game for android, I add a joystick on the interface to move the local player, But it’s weird that the touch interface on both side of the two player move the first player, when I push the joystick on player 1, player 1 moves, however, when I push the joystick on player2, the player 1 moves and player 2 dosen’t

my guess is that maybe touch inputs all always go to player controller 0, so you might need player 0 to relay that and call its respective functions with parameters on player 1’s controller

Hi!

Sorry for the late late reply. I didn’t have a pc when I read the question and then I spent days looking for the project that I did but I can’t find it.
Luckily I do remember how I did it :).

First create your own player controller and your own Pawn.

Then on the project settings define input settings. (This is a bit of a hack but it does the trick.)

Define 2 axis inputs, so P1MoveForward, P1MoveRight, P2MoveForward P2MoveRight. Now this is where the hack comes, You need to bind this defines into different types of axis. So for example make P1MoveForward and P1MoveRight match Gamepad Joystic X, and P2MoveForward and P2MoveRight match Gamepad Joystic Y.

The idea is that with a controller you would move Player 1 with the left joystick and Player 2 with the right joystick.

Now you need to create a UI that includes 4 touch joysticks and bind them to the different inputs, I don’t remember this exactly but that should be easy as the example already comes with the touch input bind to something?.

Finally you need to make 1 player only care about one inputs and another player only care about other inputs. There are multiple ways of doing this.

You can have 2 controllers (of different types) , and each player has each controller . And have different SetutInput functions on them.

Or you could have two different types of pawns with different SetupInput function.

You could even have only 1 controller that has possessed player 1 and has a reference to player 2 and whenever player2 Input gets trigger just does pawn2->MoveForward() for example.

However you wanna do it is up to you, but I think the trick was into binding different inputs to different tools that unreal provides such as different joysticks from different gamepads.