Idle Animation
Hybris_Studios
Member Posts: 5
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
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
Animate.
That's just a way to say when the actor isn't moving, to animate.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
- (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.