ZINTICK
(ZILLY)
#1
I wont a line of code to play after an animation is done playing how do i do that with out using maybe waits.
for example
someAnimation:play
somefunction() -- want this to run after animation stops playing
I want an animation to play after another animation is the main goal tho
Valkyrop
(JustAGuy)
#2
You can use Animation.TimeLength to wait until the animation is finished.
task.wait(MyAnimation.TimeLength)
ZINTICK
(ZILLY)
#3
i havent scripted in a few years what is task
?
Valkyrop
(JustAGuy)
#4
task.wait() is like wait(), but much better and more efficient.
1 Like
ZINTICK
(ZILLY)
#5
TimeLength
doesnt like exist
ZINTICK
(ZILLY)
#6
i got an error saying its not a valid member
Valkyrop
(JustAGuy)
#7
Hold on.I believe it is length
. I prob was confused by sound’s TimeLength
Make sure you have your animation track.
1 Like
TimeLength
is a property in animation that defines length of your animation play time
someAnimation:play()
someAnimation.Stopped:Wait()
somefunction()
check the animation track events, and use “Stopped” to get when the animation finishes.
https://developer.roblox.com/en-us/api-reference/class/AnimationTrack#events-1
2 Likes
ZINTICK
(ZILLY)
#10
It works! how would I make function play when an anim is over would i do it like this
anim:Play()
task.wait(anim.Length)
someFunc()
Valkyrop
(JustAGuy)
#11
You can either use Stopped
or continue with that, but just call your function after the anim ended.
task.wait(anim.Length)
will wait until your animation is finished.
ZINTICK
(ZILLY)
#12
thank you @gertkeno for the other solution
1 Like