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 Ryan_Warren · May 08, 2014 at 06:33 PM · animationfindcant

Can't Find Animation

Hello I have this script which is trying to play an animation, but every time I run it I get this error message:

The animation state openDoor2 could not be played because it couldn't be found! Please attach an animation clip with the name 'openDoor2' or call this function only for existing animations. UnityEngine.Animation:Play(String) doorOpen2:Update() (at Assets/doorOpen2.js:17)

The animation is attached to a empty game object which has a cube inside. My previous script worked and it is exactly the same appart from the animations are different, I have checked the names of the animations are correct and they are, the only difference I can find is that the animations themselves.

alt text

This one has practically no options in the inspector. (this one works)

alt text

Whereas this one has lots more options. (this one cant be found)

This is the script:

 var detectionRange : float;
 var closeEnough : boolean;
 var player : Transform;
 var doorOpen : boolean = false;
 var doorClip : AnimationClip;
  
 function Update(){
     closeEnough = false;
     detectionRange = 2;
     
     if ( doorOpen == false){
         if( Vector3.Distance( player.position, transform.position) <= detectionRange ){
             closeEnough = true;
         }
         if( closeEnough && Input.GetKeyUp(KeyCode.E)){
             Debug.Log("Opening");
             GameObject.Find("door").animation.Play("openDoor2");
             doorOpen = true;
         }
     }
 }
  
 function OnGUI(){
     if( closeEnough){
         GUI.Label(Rect(50,50,200,25), "You may press E!!!");
     }
 }

Thanks

Ryan.

opendoor.jpg (208.5 kB)
opendoor2.jpg (227.3 kB)
Comment
Add comment · Show 1
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 Ryan_Warren · May 10, 2014 at 01:41 PM 0
Share

I managed to fix it. I went on to the animation itself and changed the view to debug and changed the animation type to '1' or Legacy (I think).

0 Replies

· Add your reply
  • Sort: 

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

20 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

Related Questions

Can I make animations snap to a frame? 1 Answer

How to select an animation clip by index number? 7 Answers

Urgent please. Can't Find Scene in build settings while scene is in build settings. 0 Answers

Setting up health script. will not work, 1 Answer

Can the animation editor create local rotational data? 3 Answers


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