The DPAD’s range is from (-1 to 1), but I was wanting to use it as 4 buttons. I am not certain if this is the best solution, but I call CrouchToggle() (for example) from my ProcessDirectMovement method. CrouchToggleDelay can be adjusted as a SerializedField. This is creating a delay of a few frames so that the dpad can be detected like a regular button. If there is a better solution, I would love to hear about it.
I’ve programmed the DPAD axis in the Input Manager to only report [-1, 0, 1] to make it a bit easier to manage.
private void CrouchToggle()
{
if (Input.GetAxis("DPAD Vertical") == -1)
{
CrouchToggleCount++;
if (CrouchToggleCount > CrouchToggleDelay)
{
m_crouch = !m_crouch;
CrouchToggleCount = 0;
}
}
}