Hello Guest

Author Topic: How to transit between 2 animations  (Read 3942 times)

wijesijp

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
How to transit between 2 animations
« 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?

Tylernocks

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: How to transit between 2 animations
« Reply #1 on: May 09, 2013, 10:21:20 pm »
try something like this
Code: [Select]
if (!anim.IsPlaying("ANIMATION NAME"))
{
anim.Play("ANIMATION NAME");
}

wijesijp

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: How to transit between 2 animations
« Reply #2 on: May 10, 2013, 04:37:17 am »
since my walking animation is looping animation will it stop playing?

Tylernocks

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: How to transit between 2 animations
« Reply #3 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.