How to get the left and right special keys from two separate gamepads.
If you are like me you may have went looking for information how to get the input from the gamepad left and right special (select and start) keys during a title screen before any characters are spawned. Only to discover that such information seems very hard to come by. Hence why I am writing this tutorial. At the time of this writing the version of Unreal Engine is 5.4.1. While I will also be providing you a project file free of charge, I will also show you how to do it on your on. Lets get started!
Open up Unreal and choose GAMES - ThirdPerson, and name it what you want, I will just leave mine "MyProject2".




Again, at the time of this writing the version of UE is 5.4.1.




Go to File - New Level - Empty Level, and hit Create.




You should see an empty black space, right click in an empty spot and choose Place Actor - Class - Box Volume.




In the the Details panel with the BlockingVolume selected, we want to change its X,Y, and Z location to zero.




Now we want to grab the scale tool and using its X, Y, and Z scaling handles, scale the BlockingVolume to something resembling a floor or platform that can support several players.




Right click on the surface of the BlockingVolume about where the floor would be and choose Place Actor - Player Start.




With the Player Start selected, hit Control+C to Copy, then Control+V to paste, now select the move tool, grab the green handle and push it over some.




Go to File - Save Current Level As, and name it something, I named mine "TitleScreen" (Now you can use the main "Save All" anytime you like to save everything).




Duplicate the Third Person Character and name it "DummyCharacter00" and open it, delete everything not grouped with Add Input Mapping.




Right click an empty space in the Event Graph and search for "gamepad special", we will need the left and right one.




Right click an empty space in the Event Graph and search for "Print String", we will need two of these, name one "P00_SpecialLeft" and the other "P00_SpecialRight", and hook them up accordingly.




Compile, save, and exit.




Duplicate the DummyCharacter00 and name it "DummyCharacter01". Go inside and adjust the Print Strings to reflect the different character, changing 00 to 01.




Open up your Third Person Game Mode and add an Event Begin Play, drag off of this to a For Each Loop, for the actor class choose "PlayerStart".




Promote the Array Index of the For Each Loop to a variable.




Come out of the Array Element to a Get Actor Transform node, come out of the Array Index's integer output to a Create Local Player node.




Hold B and left click an empty place in the graph to get a branch, holding left control, drag in the Array Index variable to "get" it (conversely, drag in a variable while holding left alt to "set" it), drag out from the get and search for > (greater than) and hook it into the branch. Drag out from the blue obj output of the Create Local Player and get Enhanced Input Local Player Subsystem. Drag out from that to a Add Mapping Context node. Make sure its Mapping Context is set to the IMC Default, Plug the EXE output of the Create Local Player to the branch, plug the branch's true into the AMC node.
r



From the EXE output of the AMC node choose "Spawn Actor From Class" and choose DummyCharacter01. Plug the Get Actor Transform's transform output into the Spawn Transform input of the Spawn Actor node. Drag out from the SA's obj return node and choose "Possess". Get another Array Index, from that Get Player Controller, and plug that into the Possess node.




Copy what you can here and hook up accordingly. Taking note that the player controller node is alone with its index set to zero, and be sure to set the Spawn Actor to the DummyCharacter00.




Go into the World Settings tab of the map and set the GameMode Override to Third Person Game Mode, and Default Pawn Class to None .




Now if you hit play it should actually work (make sure you left click in the pane to gain focus), your print string should reflect either of the two gamepads left and right special buttons. You will likely notice it is very dark (cause there are no lights), and there appears to be 4 characters on screen, it is actually a splitscreen effect. Let me show you how to fix that.




Go to Edit - Project Settings, and search for "splitscreen". There uncheck "Use Splitscreen."




Now you will likely want to set the new map as the default map next time the project opens. Go to Edit - Project Settings - Maps & Modes - and under Default Maps, change the Editor Startup Map and Game Default Map to the new map.




One last thing, add this to your level blueprint and you won't have to click in the pane when you start in order to gain focus. Open the level bp, and off an Event Begin Play choose "Set Input Mode Game Only". And hook a Get Player Controller to it.