Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Azaroth · Apr 21, 2013 at 07:45 AM · arrayanimationsindex

IndexOutOfRangeException: Array index is out of range. UnityEditor.AnimationSelection.GetClipAtIndex

Hey guys, so i get this error. the problem is i dont use any of the animations in teh animation array of the animation component. I have duplicated and moved them to another folder to set the loops and stuff. Why this happens?

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

1 Reply

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

Answer by orktech · Apr 21, 2013 at 09:22 AM

Unity probably lost references to Animations for your GameObject. In Hierarchy choose your animated gameObject-> then in Inspector look in Animation section -> Animations lis. Check if all animations in that list refer to something and not "None", and size of the animation array.

The answer to your question would also be - uncheck "Play automatically" in that section. If you decide not to use animations at all, remove Animations component I hope I helped somehow

Comment
Add comment · Show 5 · 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 Azaroth · Apr 21, 2013 at 10:12 AM 0
Share

thank you, the second advice fixed it, but there is still a weird problem. On runtime the animated model (enemy) walks normally to me and in the inspector i can see the active animation to be the "run" animation but the model doesnt animate. Namely the active animation is correct, but it doesnt play it, or plays it with late. Whats the possible reasons?

avatar image orktech · Apr 21, 2013 at 01:13 PM 0
Share

I had the same issues. In your script on Start() try setting

animation.wrap$$anonymous$$ode = Wrap$$anonymous$$ode.Loop; animation.Stop(); animation.Play();

somehow it fixes my problems. Also make sure that in Animation section in Inspector you set default animation as well Another thing is your animation is probably over (played once) and its Wrap$$anonymous$$ode was PlayOnce. $$anonymous$$ake sure you set another animation when previous is over. Set Animation wrap modes correctly for run (Loop), attack (PlayOnce) etc. Good luck

avatar image Azaroth · Apr 21, 2013 at 03:02 PM 0
Share

Well, i use this in update:

if(!gameObject.GetComponent().isPlaying){ gameObject.GetComponent().clip.name);

}

I think it does the same job right?

avatar image orktech · Apr 21, 2013 at 07:48 PM 0
Share

gameObject.GetComponent().isPlaying WRONG your gameobject already has animation variable - that is use just

animation.clip.name animation.isPlaying()

avatar image Azaroth · Apr 26, 2013 at 07:10 AM 0
Share

awesome, worked thanx!!

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

12 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

Related Questions

Changing the material of all children, then change back to old one 1 Answer

Hashtable and ArrayList problem 0 Answers

Turn based games turn manager is spazzing out 2 Answers

Convert 1D array to 2D array 2 Answers

changing variable based on name of objects in array. 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