-
A small problem...
This is a really basic problem but it's kind of a big deal. (I'm also very new at this.) Whenever I have a command on an active object that changes the animation (attack for example), if I press the button too many times, it freezes on one of the animations.
I thought it had something to do with the platform movement extension that I'm using but it does the same thing on a fresh document.
Anybody know?
-
Try adding these events
+Command to Change Animation
-Change Animation to "New Animation"
-Force Frame 0
-Start Animation
-
Tried, now I just don't get the animation at all.
-
I solve this by having duplicates of the sprite, one default and one "action". If the button is pressed and default is visible, make default invisible, action visible and change the animation of action to the desired one. When animation is finished, make action invisible and default visible. This way it never freezes. Might be a simpler way?
-
I tend to use:
- If attack button is pressed
- and Attack animation is NOT playing --> Then change animation to Attack
-
MMF animation changing is kinda weird. Whenever you change the animation, always use the restore action afterward. There was something about the speed locking up or the frame being forced differently or something; I can never remember.
-
Tried all these and can't get it to work, could you elaborate on the restore animation part?
I've downloaded another example game and it doesn't have this problem at all, I just can't figure out how.
-
I would suggest that you upload the mfa here so it can be fixed or it can be be looked at and come up with a solution for you. I'm sure it's a simple fix.
-
I'm not on the computer with the file on it at the moment, but it was very simple, and happens even in a blank document. If I just give an active object an animation even with no other code, it still has the same problem.
Is this normal? Does this happen to everybody?
-
No, it's not normal and needs to be coded properly or setup properly.
-
All I'm doing is giving an active object a new animation and making a command that says when the user presses a key, it changes to that animation. Then if I press that key too fast or hold it down the object locks and won't change animation anymore.
-
I understand what you're doing, but without an exact example, it's hard to see what is going on. When you have time upload it.
-
SUCCESS! I took Jacob's advice and did it properly this time :P
I added a new condition that says:
Whenever the animation "attack" finishes
Change animation to stopped
Seems to be working. No matter how fast I press the button it will always reset and never freeze. Thanks for the input everyobdy!
-