Conflicting Animation States

0 favourites
  • 7 posts
From the Asset Store
State Machine
$10.99 USD
State Machine is a great tool for managing the state of anything in your game.
  • I'm just starting, I've been through a few of the tutorials, I've covered the manual fairly well, and I've been experimenting successfully with C2. All in all, I really like it. I wish I had more access to code (since I'm a coder by profession) but so far I really like what I see.

    However, I'm not exactly sure how to resolve an animation conflict. I have animations set up for when the character is moving, jumping, and idle or standing still. Now I want to add a keyboard event, when 1 is pressed to play an Attack animation. However, it fails to play and I believe it's because of the event condition that sets the Idle or Default animation.

    Could someone provide a little (just a wee little) advice on what I should be doing instead of how I'm doing it? Because I imagine this would actually come up quite a bit.

    Here are my events:

    <img src="https://dl.dropboxusercontent.com/u/108572298/Events.png" border="0" />

  • I've never done a platformer, but I do see all your animations are set to 'play from beginning' every tick. (they start over many times a second.)

    If there is a little green arrow like in the event next to the keyboard icon, then it is a trigger, and fires when the key is pressed.

    If that spot is blank, then it actually runs Every Tick.

    So if your PlayerBox is moving, it will always be on the first frame of 'Walk'

    If the character is moving and falling, it will show the first frame of falling, because it changes to 'Falling (play from beginning)' just after changing to 'walk' animation.

    You could try adding 'Trigger once while true' to each, so that it only fires once when ever the event becomes true again.

    Does that offer a lead to the problem?

  • I had thought the start from beginning was not what I wanted, but oddly enough moving the character around did appear to play the entire walk animation, not just the first frame as well as the Default or Idle animation. But regardless, I did as you suggested, adding Trigger Once (although truth be told, I've never used that before so am not entirely clear on if it's correct or not), then attempted to add the keyboard press of 1, but it still didn't play the attack animation.

    I suppose I'm not nearly as far along the learning path as I thought...

    <img src="https://dl.dropboxusercontent.com/u/108572298/Events_2.png" border="0" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You should do this tutorial first. It will help.

    Building a platform game - a beginner's guide

  • You should do this tutorial first. It will help.

    Building a platform game - a beginner's guide

    So the first assumption anyone makes is that I haven't done the tutorials. I have done that tutorial, several times. It doesn't have any provision to initiating an attack animation. It still doesn't allow for the Attack animation to play when I press the number 1 on the keyboard. Which is why I tried re-structuring the events on my own. In fact, here is the same key/event setup as dictated in that tutorial.

    <img src="https://dl.dropboxusercontent.com/u/108572298/Events_3.png" border="0">

  • some things you can try

    disable all other animation triggers except the attack one, does it work?

    then check wich animation trigger disables the attack one

    if not, is the animation name correct?

    if something else, provide capx

  • some things you can try

    disable all other animation triggers except the attack one, does it work?

    then check wich animation trigger disables the attack one

    if not, is the animation name correct?

    if something else, provide capx

    Yes, I feel appropriately stupid now. Spelling. Who woulda thunk... I corrected the spelling of the attack animation and it works.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)