Hey guys, so i've got two scripts. A script to represent basic melee and another to show that when u do the melee the guy loses damage. There seems to be something wrong though. This first one is my melee script.
#pragma strict

var TheDamage : int = 50;
var Distance : float;
var MaxDistance : float = 1.5;
var STANDARDKNIFE : Transform;

function Update()
{
if (Input.GetButtonDown("Fire1"))
{
STANDARDKNIFE.animation.Play("Knife Attack");
var hit : RaycastHit;
if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit))
{
Distance = hit.distance;
if (Distance < MaxDistance)
{
hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReceiver);
}
}
}
}

That script was the melee script and there is two problems im having with it. One, the enemy isn't taking damage (enemy script soon) and two, the animation wont play because "the variable STANDARDKNIFE has not been assigned.

(Enemy Script)
var Health = 100;

function Update ()
{
if(Health <= 0)
{
Dead ();
}
}

function ApplyDamage (TheDamage : int)
{
Health -= TheDamage;
}

function Dead ()
{
Destroy (gameObject);
}
any other details i should tel you: Using FPS kit, animation name is Knife Attack..... anything else?

Thanks in advance! Very Happy