[SOLVED] Making Attack Button to Untouchable Until Attack Animation Finished
ParsSO
Member, PRO Posts: 16
Hello;
I'm trying to make close fighting system(with sword) and i need help about this. How to making button untouchable until my animation is finished? I want this because when i press two times to attack button, animations are snarling. (I have 3 type of attack animations.)
My attack button;
When the button is pressed;
- Change Attribute: attack to true (attack is a global attribute. It's type is integer.)
- Change Image: To my button's hover style. (Its another image.)
- Change Attribute: AttackAnimation to AttackAnimation +1 (I have 3 type of attack animation, that's why this improves. When the AttackAnimation is 3, the value of AttackAnimation changes to 0)
I was try to timer but, it's not working. After this button i will try to make close fighting system with sword. May anyone help me about this problem please? Thanks.
And let me know please if my problem question is confusing. If its confusing, i'll try to edit this post.
Comments
You can tell if an animation has completed by checking to see if self.Image equals the name of the last image in the Animate sequence.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you. I'll try this. But how to disable button's function when the my first image(actor's default) is not seen? Should i create new rule and move all functions to new rule's inside?
Edit: I did it! When the self.image contains my breathing animation imageses name, button does nothing.
Thank you for help.
@tatiang bäm! never thought about that. I always ad internal variable ticking down(integr) once it reached 0 again global variable Cooldown active was set to false again.
My Apps
https://itunes.apple.com/de/artist/david-zobrist/id733552276
https://play.google.com/store/apps/developer?id=David+Zobrist&hl=de
@tatiang, great tip!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page