I've looked around and had no luck, so I want to ask here. I'm using an XBOX ONE controller for my game, I've set up the input, however my issue is with the Dpad itself.

Below is an example of how I want to implement the Dpad, but with actions instead of weapons:

but the problem is, I can't find any tutorials to explain how to actually go about setting something like this up. Initially, I tried going into the Project Settings, changing the Input but the Dpad is limited to axises and won't actually work as individual buttons.

What would be the best way to get the Dpad to work individually as buttons?

but the Dpad is limited to axises and won't actually work as individual buttons.

This is by design. If you want to do something specific when a D-pad direction is pressed, you can do so the same way that you would detect if a player had pushed their thumbsticks up, or left, or right, or down.

You need to check what direction, if any, each dpad axis is pointing and then do something.

The parts we specifically care about are these

float x = Input.GetAxis("DPad X");

IsLeft = false;
IsRight = false;
IsUp = false;
IsDown = false;

if (x == -1)
IsLeft = true;
else if (x == 1)
IsRight = true;

if (y == -1)
IsDown = true;
else if (y == 1)
IsUp = true;


The one caveat is I'm not 100% sure if the names of the axes are correct here, you'll have to check your input settings. But there is no "Press dpad button left". You need to check the axes to see if the user pressed it far enough left, right, up or down.

• You probably don't want to compare floats for exact equality without some rounding. Otherwise x = 0.9999f would be considered "not right". Instead, consider using a range, optionally with some hysteresis for stability. – DMGregory Mar 6 '20 at 17:05