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.