I am having an issue with the IsPlaying flag never clearing once an animation is started… I have a simple animation (about 30 frames), wrap mode = once, and play automatically = false.
The animation simply opens/closes a cover (by playing the animation forward/backward). This is driven by touching the cover…
The cover always opens properly, but sometimes SLAMS closed (like it inits/restarts, rather than playing backwards). I saw a couple of posts on the forums that to prevent this one should verify that the previous animation had completed.
However, when I try to make the NEXT animation contingent on the previous completing, via our IsPlaying flag, it ALWAYS RETURNS = True…
Anyone else having this issue? Or am I doing something wrong?
To be more exact, I have an simple cover animation. To ope the cover, I play forward (speed = 1), then to close the cover I play it backward (speed = -1). But sometimes the cover SLAMS closed… Like it initialized back to frame 0…
To prevent the “SLAMMING” effect, I had seen on forum that you should first check to see if the animation had completed playing BEFORE changing direction, or playing again… So I tried to check this with IsPlaying(“Default”) (in my case the animation is named “Default”).
The trouble is that if check this flag after starting the first animation (opening the cover), it NEVER clears… The animation plays to the end… but the flag remains set…
Seems either I am doing something wrong… or the flag is broken…
I would expect I would Play() then once the animation played to the end the flag IsPlaying(“”) would = false…
I do not understand this behavior… Anybody seems this before…
My GameObject contains an “Animation Component” with only one element in the “Animations” container. “Play Automatically” property is set to false and the “Animation” property is not set. The “Culling Type” is set to “Always Animate”
And finally it detected the new animation with IsPlaying(“newAnimation”).
I can only explain it that in some other script the same animation was initialized as “ClampForever”, so IsPlaying() always stayed true.