Animation.Play() doesen't work

Hey,

I am trying to add an Animation to my Gameobject. I already did it with my other object which plays automatically and it works perfectly.

Now i am trying to play an Animation with Animation.Play() but it doesen’t work.

What i did:

  1. Created my Object
  2. Added an animator to my Object
  3. Created my Animation with the Animation Window (when i play it in the animation window with animaiton type 2 it works, with animation type 1 not :()
  4. Created an empty animation which is my default.
  5. Added the animation to my Object and try to call it in my script with Animation.Play(“name”);

If i mark the animation type with 2 i get an error that the animation is not found. If i mark it with type 1 i don’t get any error but the animation just don’t play :frowning:

I already read alot of threads but everyone solved the problem with setting type to 1 but this isn’t the trick for me.

Any idea ?

Thank you !

Delete the Animator component and call the Animation component with animation.Play(); (small “a”)