use a button to stop another button

Get help using Construct 2

Post » Tue May 14, 2013 3:16 pm

how do i enable a button, when pressed, stop the actions of another button?

basically when my character moves i can attack at the same time which... makes things look abit silly. how can i implement a button that causes me to stop entirely and when the animation is finished the button is unlocked/enabled again so i can walk?
B
5
S
1
Posts: 88
Reputation: 653

Post » Tue May 14, 2013 4:41 pm

Create a variable "canwalk" ; 0 = the player can walk and 1 = the player cannot walk.

Then try this:

If [your walk button] is pressed
and if variable canwalk = 0
----> then the character walks.

If [your attack button] is pressed
---> the character attacks
plays animation "attack"
put the variable canwalk to 1

When the animation 'attack" is finished, put the variable canwalk to 0.
B
20
S
5
G
3
Posts: 58
Reputation: 4,136

Post » Wed May 15, 2013 10:39 am

Worked like a Charm, Thanks!
B
5
S
1
Posts: 88
Reputation: 653


Return to How do I....?

Who is online

Users browsing this forum: h1k3, LeFuji and 18 guests