- Home /
 
Animator - There's no Animation Attached??
Hello everyone,thanks for your time, I'll cut to the point.
-I've created a GameObject. -This gameObject has an AnimatOR attached. -I've created 1 Animation and UNchecked the Loop animation box in the inspector.
I created a function on a script attached to the GO called:
 void FinishedPlaying(){
 Debug.Log("Animation ended");
 }
 
               I want to play this function as soon as the animation ends the first(and only) loop. How can I accomplish this? I tried :
 Update(){
 if (!_anim.animation.IsPlaying("CodingAnimation")){
                 Debug.Log("Animation Not Playing");
                          FinishedPlaying()
             }
 }
 
               But:
get a warning with the message: "There is no 'Animation' attached to the GameObject."
2.If I use this, the function will get called everytime the animation is NOT playing and not just the one time the animation finished playing.
What do you guys recommend I try?
Thank you for your time, help and expertise! Cheers
Could you post a pic of the inspector window displaying the animator for this object?
@$$anonymous$$rSoad
Where do I upload it? In the meantime this is what it looks:
Controller: animControllerName Avatar:none Update$$anonymous$$:Animate Physics Culling$$anonymous$$ode:Always Animate
You can upload it here, use the paperclip button to add your image. If you don't see any buttons when you post a comment than try a either updating you browser or using a different browser(I had no end of problems with Firefox regarding this and had to switch to Google Chrome as a result, thought I would mention just in case).
Your answer
 
             Follow this Question
Related Questions
Keyframes of animated Child gameobject not shown by parent gameobjects animator issue ? 0 Answers
Best way to - Animation Sync - Multiple gameObjects. 0 Answers
Best Way - Animation - Multiple GameObjects. 0 Answers
changing a game object with another 0 Answers
How to play the second animation in the animator controller other than the default animation ? 2 Answers