[Problem With The 3Dplatform Tutorial's Scripts]

Hey Guys.Well this is my first post here in Unity. I have been doing the 3D platform tutorial up to the part where the copper is supposed to attack me. Well it does attack me but i don’t lose health. I have checked the script and i think the problem is in here:

if(Time.time > lastPunchTime + 0.3 (pos - target.position).magnitude < punchRadius)
{
// deal damage
target.SendMessage(“ApplyDamage”, damage);
// knock the player back and to the side
var slamDirection = transform.InverseTransformDirection(target.position - transform.position);
slamDirection.y = 0;
slamDirection.z = 1;
if (slamDirection.x >= 0)
slamDirection.x = 1;
else
slamDirection.x = -1;
target.SendMessage(“Slam”, transform.TransformDirection(slamDirection));
lastPunchTime = Time.time;
}
/This should be the original script/
The console tell me that there’s no receiver for “Slam”
I have added the Character Attack component to the Player.
I just don’t understand whats wrong
Can anyone help me out.

Hi, welcome to the forum!

First thing to check… does the target object have a method called ApplyDamage and does it reduce the health by the desired amount?

well, this is the script from the tutorial.
there is a this in it:

function ApplyDamage ()
{
animation.CrossFade(“gothit”);
}

i’m not sure whether this is the apply damage
because the character has an apply damage function as well