Search Unity

Question xbox controller d pad

Discussion in 'Input System' started by zedz, Oct 30, 2022.

  1. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    250
    I have read over the years how bad this was, but never used one.
    Now I have one thus are making my game work on it and I understand the complaints.

    left/right <> = change something, up/down ^v = change something else
    The problem is when I just want to press left (eg change weapon) 50% of the time it will also press up or down, changing something else.
    How do people deal with this?

    EDIT: OK I've just done the following, which seems to cut down most of the wrong presses (not all, but its a lot less annoying than it was)
    Code (CSharp):
    1. if ( DPAD_v != 0 && Mathf.Abs(DPAD_v) > Mathf.Abs(DPAD_h) )
    2.   DoVerticleDPAD()
     
    Last edited: Oct 30, 2022