Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Zitoox · Aug 13, 2016 at 09:10 PM · animationplaydoesnt

Animation doesn't play

I don't even know what to write. Basically, i made a animation and it doesn't play... Can someone explain me what is happening? Do i need to show anything? If yes, please let me know.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

7 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by FabriBertani · Aug 13, 2016 at 11:05 PM

Attach an script to the GameObject with the animation, something like this:

 using UnityEngine;
 using System.Collections;
 
 public class playAnimationScript : MonoBehaviour {
 
     Animation yourAnimation;
 
     void Awake(){
         yourAnimation = yourGameObject.GetComponent<Animation>();
     }
 
     // This is an example only
 
     void Update(){
         if (Input.GetMouseButtonDown(0))
         {
             yourAnimation.Play("yourAnimationName");
         }
     }
 }
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Zitoox · Aug 14, 2016 at 04:14 PM 0
Share

@FabriBertani

I forgot this! Thank you =]

avatar image
4

Answer by wesleywh · Aug 13, 2016 at 10:27 PM

Well this could be anything and the lack of information doesn't help. However, I will do my best to give you some tips of things to look at.

Tip 1: Make sure your custom animation is the correct type. If using in a mecanim "Animator" component you can't use "Legacy" animations with it. If you are using "Legacy" animations then you need to use an "Animation" component.

Tip 2: If your animation is short and doesn't loop it may be playing but will only play once. So it could be playing then stop so fast that you don't notice it.

Tip 3: Make sure your animation is applied to the correct component!

Tip 4: If you are using a humanoid character make sure that you use a humanoid animation. Sometimes "Generic" animations work but make sure these things match up.

Tip 5: If making your own animation you need to make sure that what character you make it on is the character that you are going to play it on. I have never had success making animations on one character and playing them on another (this is unless you make it with a program outside of Unity).

Hope these tips help you.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
3

Answer by itr-prototype · Mar 13, 2017 at 04:26 PM

Another thing to check: is the object you are trying to animate marked as static? In the animation preview the animation will play, but it won't in the game preview (when you press the "Play"-button) or when you actually compile and run.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by bodyxq · Jun 14, 2017 at 11:19 AM

@wesleywh: thank you so much, Tip 1 saved my day! After trying about ten different suggestions on how to fix my animation problem, just replacing 'Animator' with 'Animation' Component did the trick for me.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by BetaAnalysis · Aug 14, 2016 at 01:20 AM

If i understand correctly, you have created an animation, and now you need to play it? if so, you need to run your animation in the animator (Window>animator). You use this to play an animation, loop it, run it based on parameters in a script, and so on. Here is a link on how to use the Animator https://www.youtube.com/watch?v=wdOk5QXYC6Y

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

115 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

GUITexture touch play animation 0 Answers

Proper way to play non looping animations 2 Answers

Attack Animation problem 1 Answer

How to get an object move by itself 2 2 Answers

Ped models do not want to play one animation at the same time 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges