Search Unity

Missing/Extra Touches? Framerate related?

Discussion in 'Scripting' started by JVDesign, Nov 28, 2014.

  1. JVDesign

    JVDesign

    Joined:
    Aug 3, 2012
    Posts:
    32
    Hi All,

    I've been trying to solve this for weeks with no solution in sight.
    I have a touch button on my game (using control freak plug or incontrol plug both experience this problem)...and most of the time it works fine, but sometimes it misses touches completely, other times it's like i'm getting 2-3 touches for a single touch. I think it has something to do with the framerate because when the graphics get heavy it seems like the 2-3 touches thing happens.

    Basically I get my touches in update(), and all the physics are run in fixedupdate()
    void Update(){//Do the GUI health/spin bars here.
    buttonStickJustPressed = CFInput.
    buttonStickPressed = CFInput.GetButton("Hug");
    buttonJumpJustPressed = CFInput.GetButtonDown("Jump");
    ....


    then in fixedupdate()
    if((buttonStickJustPressed
     
  2. JVDesign

    JVDesign

    Joined:
    Aug 3, 2012
    Posts:
    32
    accidentally posted halfway though...

    if((buttonStickJustPressed))
    do something

    any help appreciated, this is so frustrating.
     
  3. JVDesign

    JVDesign

    Joined:
    Aug 3, 2012
    Posts:
    32
    ...just noticed i deleted the last half of the first buttonstickjustpressed thing....
    should be:

    buttonStickJustPressed = CFInput.GetButtonDown("Hug");