2D Toolkit Forum

2D Toolkit => Support => Topic started by: wijesijp on May 09, 2013, 10:09:42 am

Title: How to transit between 2 animations
Post by: wijesijp on May 09, 2013, 10:09:42 am
I have idle animation and walking animation. Idle animation wrap mode is set to single and walking animation set to loop.

When the player stops moving I want to continue the walking animation till the end then go to idle animation.

How to do this from code?
Title: Re: How to transit between 2 animations
Post by: Tylernocks on May 09, 2013, 10:21:20 pm
try something like this
Code: [Select]
if (!anim.IsPlaying("ANIMATION NAME"))
{
anim.Play("ANIMATION NAME");
}
Title: Re: How to transit between 2 animations
Post by: wijesijp on May 10, 2013, 04:37:17 am
since my walking animation is looping animation will it stop playing?
Title: Re: How to transit between 2 animations
Post by: Tylernocks on May 10, 2013, 06:41:36 am
Yeah, It works like the .fbx animation, as long as the play animation condition is in active(for example: if you press right on your keyboard), it will play.