Problem with the Animate Behavior

sewinstonsewinston Member Posts: 51
edited November -1 in Working with GS (Mac)
Hi. I'm not sure how to phrase this in a short question so I will just tell you what I'm doing...

I have 4 walk cycles, one for each direction, linked to an arrow key, using the "Animate" behavior to display the walk cycle. when the arrow key is released, I wave the "Otherwise" linked to a "Change Image" behavior to display the actor standing still in the direction he was walking. This works fine.

Where I run into a problem is when I attempt to set up a rule to attack. I created 4 new rules, each one looking for the standing still image for their direction, and then using the "Animate" behavior to trigger the right animation. Again this works fine but the animation freezes on the first frame. If I activate the 'Loop' option it still freezes after the first frame. If I activate the 'Restore actor image when done' option, it loops between the standing still image and the first frame of the animation.

Am I doing something wrong here or is this just a Beta Bug?

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    What I think is happening is the Otherwise part of the rule is overriding things as it continues to run if the rule is false.

    I just made a quick test project and this should work.

    Create a boolean attribute, 'standing', to signify if it is walking or standing.
    Add a rule that says if Any of these conditions are true:
    -- key is 'left' and is down
    -- key is 'up' and is down
    -- key is 'right' and is down
    -- key is 'down' and is down
    ----Then Change Attribute 'standing' = 0
    -Otherwise Change Attribute 'standing' = 1

    And in your rules of when you have you movement keys pressed to begin movement, do not add anything in the otherwise.

    Add a rule that when Attribute Has Changed: 'standing' is true
    ---Your 4 rules depending on which direction you are facing, change image to the correct image.
  • sewinstonsewinston Member Posts: 51
    Thanks, it's working correctly now.
Sign In or Register to comment.