Jumping vs. Falling Animations - Need help pleeeease :)

JodyMitomaJodyMitoma Member Posts: 307
edited May 2014 in Working with GS (Mac)

Good morning to you!

So, I've done my research and looked around, but found no answers to my specific need.

I have a jumping animation (4 different jumping animations that play at random, actually), and I WANT it to play the full animation when my Player actor jumps. The animations are 12 frames, and they lasts the entire duration of the Jump (I'm talking from escalation, right back down to the ground "platform".) This is all working fine and dandy.

My PROBLEM however is this...
When the Player actor simply drops off of an object (NOT jump off, just DROP), I don't want the "jumping animations" to play! I want him to simply have his normal pose when falling off of an object/platform.

I've tried a LOT of different things, but I simply cannot get him to NOT animation when falling off an object/platform. He is acting as if he is jumping, and it looks rather silly.

Thanks for any assistance I get. Really appreciated, as always. :)

Comments

  • ChefsaladChefsalad Member Posts: 10

    Just a thought, but I have done this with great success. Create a duplicate of your main actor without the animation sequence. Create an invisible barrier with no density between the platforms, and trigger the spawn of the new actor that has no animation with a collision of your original actor and the invisible platform. This method works really well for me, and doesn't seem to show any odd transitions when spawning the new actor.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    You should be able to tell when the player wants the actor to jump, right? Are you pressing a button? A key? If you are, you may be changing an attribute to true so you can trigger the jump.

    By the way your thread is worded, it sounds like you may be using Linear Velocity to tell if the actor is falling or jumping. You could wrap your animation in a rule that says when Jump is true, and linear velocity is X: Play animation.

    It would also help to see your rules.

  • JodyMitomaJodyMitoma Member Posts: 307

    @Chefsalad said:
    Just a thought, but I have done this with great success. Create a duplicate of your main actor without the animation sequence. Create an invisible barrier with no density between the platforms, and trigger the spawn of the new actor that has no animation with a collision of your original actor and the invisible platform. This method works really well for me, and doesn't seem to show any odd transitions when spawning the new actor.

    That is a very interesting way of setting things up. I think I will go a different route, but thank you for your suggestion. I don't want to spawn anything in this game.

  • JodyMitomaJodyMitoma Member Posts: 307

    @Braydon_SFX said:
    You should be able to tell when the player wants the actor to jump, right? Are you pressing a button? A key? If you are, you may be changing an attribute to true so you can trigger the jump.

    By the way your thread is worded, it sounds like you may be using Linear Velocity to tell if the actor is falling or jumping. You could wrap your animation in a rule that says when Jump is true, and linear velocity is X: Play animation.

    It would also help to see your rules.

    Yes, the player will know to jump because they will have obstacles to jump over. They will be tapping anywhere on the screen to make the MainPlayer actor jump.

    I am using self.jumps = 1 and game.touch(specific area) rules to activate self.motion.linearvelocity-Y to 750, then switching self.jumps to 0 (only one jump until lands back on platform, then can jump again).

    Then I have another rule set for "if self.jumps = 1", then play "running animation".
    "else, play 1 of 4 jumping animations randomly".

    PS. The MainPlayer actor for my game currently has 15 (no joke) different MAIN Rules (not taking into account whatever other rules are sub'd inside the MAIN Rules, and you'd be shocked at how many Behaviors are in some of the MAIN Rules! It's ridiculous, but this game is keen to being very detailed in its ways. I hope my game doesn't run slowly (Preview seems to be quite smooth thus far).

  • JodyMitomaJodyMitoma Member Posts: 307

    On a side note, my MainPlayer actor has a set VelocityX of 250 to run throughout the level.
    And I have an Accelerate at 270 degrees with accel of 2500 set for gravity. Not using scenic gravity, of course.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    If self.Jump = 1 activates your jump, why do you having it playing a running animation?

    @JodyMitoma‌ said: I am using self.jumps = 1 and game.touch(specific area) rules to activate self.motion.linearvelocity-Y to 750...Then I have another rule set for "if self.jumps = 1", then play "running animation".

  • JodyMitomaJodyMitoma Member Posts: 307
    edited May 2014

    @Braydon_SFX said:
    If self.Jump = 1 activates your jump, why do you having it playing a running animation?

    JodyMitoma‌ said: I am using self.jumps = 1 and game.touch(specific area) rules to activate self.motion.linearvelocity-Y to 750...Then I have another rule set for "if self.jumps = 1", then play "running animation".

    No sorry, you're interpreting that incorrectly. self.Jumps = 1, in my mind means, The player has 1 jump left. (So if that is the case, player is currently running, thus play the "running animation".)

    When self.Jumps (remaining) = 0, then play a 12-framed jumping animation at random because player has no jumps left, thus must be in mind-air. :)

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Okay, I see what you're saying.

    Let me see if I can make a quick demo. Back in a moment

  • AdrenalineAdrenaline Member Posts: 523

    It kinda seems like your jump count isn't being used as forcefully as it should be. Meaning, that should be the only thing that determines if the player can jump or is jumping. It sounds like you're also checking to see if they're on the ground - if they are not, then they are jumping.

    The Y velocity (or contact with the ground, or whatever else you are checking) should not be used to start a jump animation. If you ONLY check the jump count, and ONLY change the jump count when they player presses the jump button, I can't imagine a world in which you'll continue to have this issue :)

  • JodyMitomaJodyMitoma Member Posts: 307

    @Adrenaline said:
    It kinda seems like your jump count isn't being used as forcefully as it should be. Meaning, that should be the only thing that determines if the player can jump or is jumping. It sounds like you're also checking to see if they're on the ground - if they are not, then they are jumping.

    The Y velocity (or contact with the ground, or whatever else you are checking) should not be used to start a jump animation. If you ONLY check the jump count, and ONLY change the jump count when they player presses the jump button, I can't imagine a world in which you'll continue to have this issue :)

    No idea. Followed a few tutorials and did what seemed logical at the time. Hopefully all is well. I don't recall ever having two things being checked before a user can jump.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Here's a screencast preview. Is this kind of what you're looking for?

  • JodyMitomaJodyMitoma Member Posts: 307
    edited May 2014

    My MainPlayer actor has the following Rules and whatnot:

    ** Parallax BG stuff

    ** Accelerate Gravity down

    ** Bottom destroyer (kills Player if falls to bottom of screen)

    ** Collide with SOLID's

    ** Control Camera

    ** If collide with solid, change jumps to 1 (or crap, maybe you were right Adrenaline?)

    ** if self.jumps = 1 AND if game.touch screen, play jumping sound, change velocity Y to 750, and change self.jumps to 0.

    ** if self.mation.linearveloY is less than set value, destroy player & reset scene

    ** Popup menu that shows be level begins

    ** run into object = death rule

    ** walking & jumping animation stuff

    ** timer for jump sequence animation change

    ** constrain self.motion.linearveloX to 250

    ** constrain game.mainActorX to self.position.x

    Things get confusing very quickly around here! O.O

  • JodyMitomaJodyMitoma Member Posts: 307
    edited May 2014

    @Braydon_SFX said:
    Here's a screencast preview. Is this kind of what you're looking for?

    Hehe, that it is, but I have something I must note your way. Very important as well.

    My jump animations are 12 frames long, and they last the ENTIRE duration of the jump itself. From the moment they take off, until the moment they hit the ground again. It is timed perfectly. When they're at max velocity and headed back down, they are NOT in a still framed state such as yours, which is why this is as difficult as it is.

    So because of this, I cannot simply use VelocityY <= -1. I need to go another route. Any ideas? :)

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    You're not making this easier. ;)

    12 frames? No problem. It depends on how high your actor is jumping and how fast your animation is playing. This demo is pretty simple, so I'll message you a download link as I cannot post a direct link on the forum. The animations will not be included as they belong to an artist. Getting your own animations in should not be a problem.

    This demo is pretty solid and clean, so you should be able to dig through it and export what you need.

    Hopefully it helps!

  • JodyMitomaJodyMitoma Member Posts: 307

    @Braydon_SFX said:
    You're not making this easier. ;)

    12 frames? No problem. It depends on how high your actor is jumping and how fast your animation is playing. This demo is pretty simple, so I'll message you a download link as I cannot post a direct link on the forum. The animations will not be included as they belong to an artist. Getting your own animations in should not be a problem.

    This demo is pretty solid and clean, so you should be able to dig through it and export what you need.

    Hopefully it helps!

    Wait a minute, are you telling me that you actually got exactly what I need?! :open_mouth:

  • JodyMitomaJodyMitoma Member Posts: 307

    No, that didn't do it for me. There was nothing there relating to animation. Thanks anyway.

    Still need help, if anyone else has any ideas.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited May 2014

    @JodyMitoma‌ - The logic is there. I'm not going to try and get a 12 framed animation to be timed perfectly or anything, but that logic is what you need. It's exactly what I used in the demo screencast.

    All I did was add animation in the movement rules. That's all.

  • JodyMitomaJodyMitoma Member Posts: 307

    @Braydon_SFX, in your demo the little guy isn't animating on his way down. But if I were to lengthen the animation, are you telling me that he would animate on his way down from his jump as well?

  • JodyMitomaJodyMitoma Member Posts: 307

    Hmmm, maybe he is "animating" on way down. I best take a second look. Very hard on the brain, sorry about that Braydon.

  • JodyMitomaJodyMitoma Member Posts: 307

    @Braydon_SFX, Oh, right! I gave up when I noticed that your project has key inputs for the MainPlayer to move.

    My game is pretty much an "endless runner", but with specified level design (and actually endings). So, you do not control the MainPlayer actor at all, except for tapping on the screen to make him jump.

    Sorry!

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    There are no animations in the demo I sent because the animations weren't mine to give away. If what you want is in the demo screencast I shared, then this demo file will help you. It has different logic as to how things move and jump -- that logic should make your job easier and help you find a solution to your problem. Think of the demo as a stepping stone. It's a demo, not a complete game.

  • JodyMitomaJodyMitoma Member Posts: 307
    edited May 2014

    Insane. After about an hour of tinkering with my project, I finally got it. Braydon, I truly do appreciate you taking the time to show me that file, but it really was making things harder for me, so I didn't look into it after I noticed that your project was using keyboard input for moving around, whilst mine moved on its own.

    I had an extra change attribute in there I didn't need, and then I added a new rule for the 4 randomized animation sequences, to fix it up and it worked, which should have been very obvious on my part... Unreal that it took me 3 hours to figure this out. Bed time. :/ lol.

    In other news - Sometimes I truly do hate being a perfectionist... :P But maybe it'll be worth it in the end. Time will tell.

Sign In or Register to comment.