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 Elektrobomb · Nov 18, 2014 at 04:54 PM · erroranimatorcomponentmissing

Missing component exception in unity. there is no animation component attached but a script is trying to access it.

However, i have made not references t this component in my script. all i try to do is edit an animator float.

this is my script:

 #pragma strict
 internal var animator : Animator;
 var dead : float;
 var Health = 100;
 animator = GetComponent(Animator); //assigns Animator component when we start the game
 
 function Start () {
  
 animator = GetComponent(Animator); //assigns Animator component when we start the game
 }
 
 
 function Update ()
 {
 
     if (Health<=0)
     {
     dead = 0.2;
     }
     else
     {
     dead = 0.0;
     }
 
 }
 
 function ApplyDamage (DamageAmount : int)
 {
     Health -= DamageAmount;
 }        
 
 /*function Dead()
 {
     Destroy (gameObject);
 */
 
 function FixedUpdate ()
 {
 animator.SetFloat ("Dead",dead);
 }

and this is the error:

MissingComponentException: There is no 'Animation' attached to the "vincent" game object, but a script is trying to access it. You probably need to add a Animation to the game object "vincent". Or your script needs to check if the component is attached before using it. UnityEngine.Animation.Play (System.String animation) (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/EditorGenerated/Animations.cs:569) Damage Reciever.Update () (at Assets/Damage Reciever.js:19)

Thanks in advance.

Edit: I DO have an Animator component, but it is commenting on the Animation component which i make no references to in my script.

Edit2: alt text

troublesahooting.jpg (465.8 kB)
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

Answer by Jeff-Kesselman · Nov 18, 2014 at 04:56 PM

The problem is exactly what it says it is.

 animator.SetFloat ("Dead",dead);

This tries to set a field on the animator component, but you have none on the object.

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 Elektrobomb · Nov 18, 2014 at 05:17 PM 0
Share

But i do have an animator component, just not an animation component

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

2D Animation does not start 1 Answer

An instance of type 'UnityEngine.Animator' is required to access non static member 'GetBool' 1 Answer

Missing Component Exception Error 3 Answers

Missing parts when I build my game.... 2 Answers

Stealth Tutorial DoubleDoorAnimator Problem 0 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