Author Topic: "Releasing" ButtonInput?  (Read 1977 times)

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
"Releasing" ButtonInput?
« on: June 15, 2013, 04:58:59 PM »
Hey there!

I have problems changing from one animation to another while pressing buttons, here is the scenario:

1. The character walks around (walking animation) - pressing the Movementbuttons
2. An Enemy appears
3. Character walks into Enemy and is hit (hit animation) - pressing STILL the movementbuttons, while the hitanimation is played
4. Character is stuck in the hitanimation and "walks" with this animation, till I release the Buttons.

The movement and animation is done by a script with an "OnPress"-Method, the Rest (getting Hit by Enemy etc.) is done in PlayMaker.
I wanted to tackle it like this:

- while the Movementbuttons are still pressed and the Player gets hit <-> in that State where he gets hit I wanted to "disable" or "release" the Button internally. Is this possible, if so: how? :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: "Releasing" ButtonInput?
« Reply #1 on: June 15, 2013, 06:05:14 PM »
I could tell you how to do it via code, but it sounds like you want a playmaker-based solution -- and I have no idea.

BehindTheStone

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 135
    • View Profile
Re: "Releasing" ButtonInput?
« Reply #2 on: June 15, 2013, 06:06:57 PM »
I would like to see the Code-Solution :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: "Releasing" ButtonInput?
« Reply #3 on: June 15, 2013, 09:19:44 PM »
UICamera.currentTouch.pressed = null;