Controller doesn't work in PIE for me

I tried to use both a PS5 and an XBox One controller in the editor in PIE and it doesn’t seem to work.

Strangely it works in standalone and in a package.
Is anyone aware of a setting that could fix this?

Somewhat belatedly, I just had this problem myself and finally figured out the answer by wandering through the code.

(This is operating on the assumption that you have made certain that you don’t have the “use controller 1 for player 2” in multiplayer testing, of course.)

It comes down to the fact that Unreal is very literal about “controller 1” when doing Play-in-Editor.

In the actual viewport, it will take input from any controller to move around. In Play-in-Editor, it will only use very specifically XInput device slot 0. So if you’re using a device that happens to be the device in the second slot, even if it is the only device connected so far as you know, it will work in the editor viewport but not Play-in-Editor.

The practical upshot of this is that if, say, you had an MMO keypad installed at one point that is still sitting there in an XInput slot – or any similar thing that happened to take up an XInput slot – then the controller you’re using to move around in the editor (i.e., not the first controller) will cease to work in Play-in-Editor as a result.

However, when playing standalone or packaged, it’s more lenient; controller 1 from the viewpoint of the game is simply “the first connected controller I see”.

tl;dr version: Make sure you don’t have any unexpected XInput devices sitting around that might be eating up an XInput slot unbeknownst to you.

It’s great you have told us why it doesn’t work, but an explanation as to how to select a controller in PIE would be better. IE, its not working because you may have another Xinput device connected, so how do you tell the engine to use the controller you’re expecting? Also given the length of time since last post i’m on UE5. A dev response would be appreciated.

If I had an answer to that, I promise I would’ve included it. In my case, getting rid of the additional spurious XINPUT device was sufficient to make the controller I was actually using become the first controller, and thus it now worked in PIE.

Since in standalone or packaged mode it already works fine—the issue only applies to PIE—it wasn’t something I wanted to spend additional time debugging and then writing an engine patch to submit to Epic, when that was time I could spend on code for my actual game instead.

This document explains more about this Xinput problem:

You need to follow the steps to resolve Xinput slot fighting:

  • Download and extract the Process Explorer archive
  • Execute the procexp64.exe to open Process Explorer

  • Click at the Find tab on the top and then select Find Handle or DLL…

  • Search for XInput and wait for the results, it might take a few seconds for all the entries to appear

You will find that Chrome, or the Epic helper, or the Epic crash reporter, or the Nvidia process, or something else is using XInput.

End those tasks in the Windows task manager and then use the XInputChecker tool mentioned in the document above to see the Xinput slot allocations.

This worked for me today, and now I’m cooking with UE5 :slight_smile: