How to print string when pressing left and right special buttons on pad 00, and also for pad 01???

Bump bump. got to be an easy way to do this.

1 Like

I’m curious how game pads work.now you plugged in two pads,the 2rd pad’s button doesn’t respond?
if it responds ,I have an idea making local multiplayer…

It’s just like treating the two pads as a single device with separate buttons.

make the camera a unique pawn.have it represents the player.it receive all pads input to control different character.those characters are “AI” .they don’t need different “player controller”
That’s how I think of making a local multiplayer.
but not sure if the gamepads work as I think.because I don’t have gamepads available at hand to test.

1 Like

I just talked to someone that knows UE pretty good and they have no idea how to do it.

It’s not that the pad is not working because it does in WIndows you can check it. The problem is gaining access to that second pad’s buttons. And this is without spawning a character.

I wish it were that simple but apparently it is not. Imho, this should be handled under project settings. Over both Action and Axis event we first set a desired input device or disable. This would solve this problem real quick, that way when you called an action or axis input event it is already mapped to the correct device.

I am starting to get how a certain game controller is attached with the possession of a pawn. But that is not the case here. This is just a simple empty level with nothing, save maybe a widget for our title screen. All I am trying to do is get the select and start button on the second gamepad to print string. And a way to discern different pads right here would be nice.

I am kind of already doing that with camera actors.

If it makes you feel better, it seems that many that use this engine don’t understand it either.

bump bump…junk in the trunk

You will most likely need cpp anyway, like an event to detect gamepad for connection/disconnect.
On cpp we have a delegate for this " OnControllerConnectionChange" but is not exposed from blueprint from what i can tell(or not yet).
Try to look for other function on cpp that can assign a controller id(when CreatePlayer) to a deviceID.
Source: How do you detect a second gamepad for splitscreen? - #2 by dunenkoff

1 Like

I didn’t get anything out of that link but thanks for posting.

Bump bump…

So do I need to “create player” in the game mode off of begin play?

The above pic is in the game mode. Right there where it says it will spawn a new controller, how to link this to a game controller I have made?

You need to assign the new user id to the create player:

Here the player controller bp:

Req:

  • World Setting has the correct game mode
  • World Setting has the correct player controller bp
  • Skip Assigning Gamepad to Player 1 is checked from project setting
  • Your gamepad controller is actually detected by unreal(some logitech doesnt work and some ps4 controller need other software to get detected properly)
  • You will need cpp for the function delegate “OnControllerConnectionChange” to make a proper event to connect/disconnect a gamepad(this is not exposed on bp) and replace the eg above from my gamemode bp event begin.
1 Like

I have followed most of what you are saying.

Yes, it is still the default third person template game mode.

I set this to the P01 player controller I made.

Got it

They are both xbox one controllers, one white, one black, Windows sees them, so does UE.

Ok this one I am confused about. I understand you want me to use OnControllerConnectionChange instead of the Event Begin Play in the game mode? I find nothing when searching for that. As of right now, it prints string when either gamepad’s left special / select button is pressed. I want to be able to differientiate each different pad. Please advise me more about that final step the cpp and OnControllerConnectionChange, thank you for helping me.

From my side i can differientiate both gamepad, am not sure why yours not working.

You should also get these 2 popup when you start the project, as you can see it auto assign the user ID:

Try to print string this return value: expect a value of 2 (for the 2 gamepad)

Am using DS4Windows with 2 ps4 controllers if that make any difference for other people.

Probably because you didn’t explain the last step lol, cpp OnControllerConnectiobChange. What is this? Is this C++ or blueprints? Please explain this further, thank you.

I do

I have tried with second gamepad but not printing.

On an empty Title screen level, I have an actor bp named “Dummy” dragged into the map, this executes some widget and other code.

Off of Begin play I got all active users, got a copy, printed string, and it showed this.
Image1

So UE sees the devices. Great! Now how to weld device 0 to PC_00 player controller and device 1 to PC_01 player controller? That is the question. Does anyone know? bump bump…

bump bump

Bump in the day.

bump bump

The question is solved here. All Star Tutorials