- Home /
Can't Play Animation Clip When More Than One Clip Is Added To Animation
I've got a script that plays an animation clip based on input from the user. The heart of the script is simply:
animation.Play(value, PlayMode.StopSameLayer)
Where value is just the name of the clip. This worked fine when there was only one clip in the animation but after I added two more clips, the animation no longer plays. I've verified this code is getting called, I've verified the input string is correct, and I verified all the clips are on the animation object and that the animation is added to the correct object. I'm not sure what else to try. I can run the animation in the Animation Editor and it works fine but when using animation.Play(...) it appears to not be able to find it. Anyone seen something like this before? What might I be doing wrong?
I reverted the scene, kept the animations, and reconfigured the gameobject to have just the one animation which is how it was working previously but it still doesn't play when using Animation.Play() so I'm thinking its specific to the new clip(s).
maybe show us more of the code, in case we see an issue there?
i'm having exactly the same problem . if you guys have any solution . please help .
How did you add the new clip? Did you edit the original animation clip, like say, 'split' it into several different ones?
Answer by angi · Jan 31, 2011 at 03:13 PM
I had the same problem and wondered why it wasn't working... You have to define your clips in your fbx (as you did), after that click on the object containing the animations in the hierarchy view. There you can set the animation size and add your clips. Hope that helps