Running Animation Question

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hello all,

    I'm new to mmf2 and I have a (noob) question about the running animation. I have the sprites for the walking and running animation but what is the best way to run the running animation?

    I want to hold shift for my character to run. Once I let go of shift, it goes back to walking animation. This is what I did:

    Repeat while "shift" is pressed - change animation sequence to running.
    X Repeat while "shift" is pressed - restore animation sequence.

    This accomplished the walk to run animation. Two problems though:
    1. When I hold shift, the animation plays without the character is moving.
    2. The second condition blocks out any other key presses. For example. If I wanted another animation to play by pressing another button, it won't work because of the second condition.

    What is the best way to have the character go from walking animation to running animation? How are you guys coding the running animation? I looked around and can't seem to find an answer. A link or your guidance will be much appreciated.

    Thank you for your time.

  • What type of movement are you using? Built in platform movement or the Platform Movement Object? If you're using the PMO, try this

    -Character "Running" is playing (right click and hit "negate, this will put a red X next to the animation)
    -Character "Walking" is playing (negate this too)
    -Object is Moving (this is for the PMO, negate it as well)
    >- Character animation change to "Idle" or stopped or whatever you have named for your standing animation. if this doesn't help, post your file and i'll help you out :)

    Developer/Composer :

    Vamprotector

    Castlevania Chronicles 2 - Simon's Quest

    Castlevania Chronicles 3 - Dracula's Curse

  • Try something like this:

    User isn't pressing the direction arrows -> set variable "running" to 0 / variable "buildup" to 0

    Every 1 second + User is pressing (right or left arrows) -> Add 1 to variable "buildup"

    If User is pressing (right or left arrows) and variable "buildup" < 4 then (move the guy right or left a little bit) + change animation to "walking"

    If User is pressing (right or left arrows) and variable "buildup" >= 4 then (move the guy right or left a little more) + change animation to "running"

    Something like that.

    Weebish Mines, my retro Metroidvania!
    Please login to see this link.

  • Warmachine,
    Attached is what I have so far.

    Please login to see this attachment.

    Del_Duio,
    That is a good idea. I might try that but I would like to see if I can create a "run" button by just holding down shift. If not, something like that might work for me.

  • Thank you sptpieman. I wasn't able to download it because of maybe I have 2.0, but I made the changes you did. It worked. My character does not do the run animation while holding down shift.

    But, I am not able to play the other animation by pressing Z. I'm not sure if your file that you attached has the same problem, but how would that be addressed?

  • wait, that thundershock is supposed to be working? I thought it wasn't implemented yet. Yeah, it didn't work when I downloaded the file, but I'll take a look and see what can be done to fix it.

  • Sorry SilkyPop, but for the life of me I can't seem to figure this out. Everything looks like it is in place, and Pikachu does indeed stop when Z is pressed, but it doesn't play the animation. I suspect the idle animation is taking priority due to you using the the built in keyboard. There's an object called Key Object you can get in the extension manager that should fix this. It even has a key released function, so creating the sprinting should be even easier.

    Sorry I couldn't help further.

  • I got it working! And without the Key Object too! Okay, what you need to do is where you have "X repeat while shift is pressed OR (logical) speed = 0", insert a "X animation thundershock is playing".

    Okay, noticed a slight hiccup. It seems thundershock doesn't work unless you are running. You'll need the Key Object to fix this. Change "X repeat while shift is pressed" to "On Key number 160 released".

    Also, when you thundershock you have it set to where you can shoot up and down even though there's only animation for left and right. So where you have animation "upon pressing Z" insert a "user is facing direction" and check both left AND right. This will make sure you can only thundershock while facing left or right.

  • Nice! But it seems to work only when he's running. When I'm at a standstill, the thundershock animation is not playing. But this is a step in the right direction. I'll play around and see if I can add more conditions like that in each condition.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!