Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Stop Animation At Last Frame
« previous
next »
Print
Pages: [
1
]
Author
Topic: Stop Animation At Last Frame (Read 5058 times)
Tylernocks
Newbie
Posts: 15
Stop Animation At Last Frame
«
on:
May 08, 2013, 06:26:17 am »
I have a death animation, I want for when it meets its last frame for it to remain on the frame until it get re-called
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Stop Animation At Last Frame
«
Reply #1 on:
May 08, 2013, 09:41:07 am »
If you set the animation clip loop type to single, thats exactly what will happen - it will stop at the last frame.
Logged
Tylernocks
Newbie
Posts: 15
Re: Stop Animation At Last Frame
«
Reply #2 on:
May 09, 2013, 03:04:17 am »
How do you do that, changing the wrap mode to single reduced it to the one frame only. I want the animation to play but just stop at the last frame and not loop.
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Stop Animation At Last Frame
«
Reply #3 on:
May 09, 2013, 09:42:26 am »
Apologies. That was a typo. I meant to type
Once
, not Single.
Logged
Tylernocks
Newbie
Posts: 15
Re: Stop Animation At Last Frame
«
Reply #4 on:
May 09, 2013, 10:19:57 pm »
hmmm...seems that didnt work either, I set it to once but it still loops
here's the script
Code:
[Select]
State = CharacterState.Dead;
if (!anim.IsPlaying("Death"))
{
anim.Play("Death");
}
The wrap mode is set to once
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Stop Animation At Last Frame
«
Reply #5 on:
May 09, 2013, 10:21:45 pm »
If you're calling this from Update, your code will restart the animation every time it stops playing... You need to only call Play once when you switch to the CharacterState.Dead state.
Logged
Tylernocks
Newbie
Posts: 15
Re: Stop Animation At Last Frame
«
Reply #6 on:
May 09, 2013, 10:43:41 pm »
It worked YES!!!! Best support ever!!!
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Stop Animation At Last Frame