Idle Animation

Hey guys I am new to GameSalad and to the forums. I need to setup an Idle animation for a character I have in GameSalad. This is a platformer type of character movement. I have the character playing walking animations for movement, (pressing A and D, left and right), and a jumping animation when pressing W. I want the character to play the Idle animation whenever there is no input happening, or basically when the character is standing still. How can I set this up? I need the Idle animation to stop playing when the other animations start. Please baby step me I am very new. Thanks guys!

Comments

  • pixelstixpixelstix Member Posts: 6
    if [insert time] has past with no input
    change attribute 'idle' to TRUE

    if 'idle' is TRUE
    play idle animation

    if user has pressed an input key reset timer
    change 'idle' to FALSE
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited January 2013
    You could also say when self.motion leaner velocity X and Y = 0
    Animate.

    That's just a way to say when the actor isn't moving, to animate.
  • Hybris_StudiosHybris_Studios Member Posts: 5
    Thanks guys, got it working! I went with Braydon_SFX instructions because I could figure it out, noobie here. PixelStix, I am interested in trying it your way as well, however I am unsure how to set it up in the editor. Could you explain it in a more high level way? I am really new to GameSalad and programming in general. Thanks again guys!
  • pixelstixpixelstix Member Posts: 6
    edited January 2013
    I would create the following attributes first:
    - (boolean) 'playerIdle' = false
    -(int) 'idleTimer' = 0

    Create an actor called 'idleController'. This actor will control the timer. In the actor 'idleController' create the following.

    Timer - Every second
    -Change Attribute - 'idleTimer' to 'idleTimer' + 1
    -Rule - if 'idleTimer' = '5'
    -Change Attribute - 'playerIdle' to true

    Then in your actor that you keep your idle animation place this

    Rule - if 'playerIdle' = true
    -Play Animation [idle animation] [check loop]

    Then place this in all of your input keys

    Change Attribute - 'idleTimer' to 0
    Rule - if 'playerIdle' is true
    -Change Attribute - 'playerIdle' to false

    I hope this helped! :)

    EDIT: It doesn't let me keep spaces for code indenting the '-' means that goes in that block of code for example, the Change Attribute - 'playerIdle' to true belongs in the Rule above it.

  • Hybris_StudiosHybris_Studios Member Posts: 5
    Thanks guys, awesome info! It is working nicely now.
Sign In or Register to comment.