Search Unity

Check how firmly a button is pressed

Discussion in 'Scripting' started by 0tacun, Feb 10, 2015.

  1. 0tacun

    0tacun

    Joined:
    Jun 23, 2013
    Posts:
    245
    In many games on the consoles a different action occurs depending how firmly a button is pressed. For example in Metal Gear Solid, if you hold thight the R1 button you begin to choke the grabed enemy, in Pro Evolution Soccer, a soft button touch kicks the ball only a few meters forward, etc.

    Is is possible within the Unity Inputsystem? The buttons only know 3 checks (OnButton, OnButtonDown, OnButtonUp), so I am wondering how to do it. One solution could be to treat every button as an axis, but I am afraid that most buttons are not threated as an axis.

    Has someone any info on this?
     
  2. toreau

    toreau

    Joined:
    Feb 8, 2014
    Posts:
    204
    0tacun likes this.
  3. 0tacun

    0tacun

    Joined:
    Jun 23, 2013
    Posts:
    245
    Alright, thank you.
     
  4. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    In metal gear, its not about how hard you press, but for how long, a short tap to choke out, or a long hold to restrain, etc
    Only on the ps3 game was there actually analogue pressure differences with the button inputs, and some users didn't like this
    x360 controllers do not have analog face buttons
     
    Mycroft likes this.
  5. 0tacun

    0tacun

    Joined:
    Jun 23, 2013
    Posts:
    245
    @hpjohn: This is not true for Metal Gear Solid 2/3, I don't know how it is implemented in 5.
    To grab: lightly press and hold O.
    To choke them: tap O somewhat rapidly until you see stars above their head.
    To snap their neck: continue to tap O until they lose consciousness.
    To slit their throat: press and hold O in a "hard" press.

    Anyways thanks again for the info, it's sad that this feature vanished from the current controllers.
     
  6. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    http://en.wikipedia.org/wiki/DualShock
    Well there you go, i didn't even remember the ps2 had analog face buttons too (I mean, I must have at some point, for mgs2/3 [10/14 years ago]) it must have been such an unnecessary feature for most games.