Author Topic: Problem simultaneously pressing multiple buttons  (Read 1580 times)

sterlingware

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Problem simultaneously pressing multiple buttons
« on: July 13, 2014, 11:16:56 PM »
I'm stumped on a problem: I've got 4 UIButtons in my scene (left, right, jump, shoot). I can press & hold buttons individually. However, if another button is tapped or pressed, the button I'm currently pressing gets released - e.g. tapping shoot while holding down left releases the left button, even though I'm still pressing it.

There's only 1 UICamera in my scene, and Allow Multi Touch is checked. I've also tried using several cameras on different layers (1 per button), but that did not solve my problem.

Has anyone an idea what's going on?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem simultaneously pressing multiple buttons
« Reply #1 on: July 15, 2014, 12:10:44 AM »
It's just a visualization glitch. Change UIButtonColor's OnSelect function to this:
  1.         protected virtual void OnSelect (bool isSelected)
  2.         {
  3.                 if (isEnabled && tweenTarget != null)
  4.                 {
  5.                         if (UICamera.currentScheme == UICamera.ControlScheme.Controller) OnHover(isSelected);
  6.                         else if (!isSelected && UICamera.touchCount < 2) OnHover(isSelected);
  7.                 }
  8.         }

sterlingware

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: Problem simultaneously pressing multiple buttons
« Reply #2 on: July 15, 2014, 08:20:46 PM »
Problem solved! Thanks.