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:

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