I have my 2 scripts. 1 sends a message Apply Damage when it collides with the trigger. but the goblin I’m fighting does not receive any damage.
attack script
function OnTriggerEnter(other : Collider)
{
SendMessage("ApplyDamage", Dammage, SendMessageOptions.DontRequireReceiver);
Debug.Log("HI");
}
Enemy Script
function ApplyDamage()
{
animation.Play("block_hit");
animation.Stop("attack1");
chasing = false;
Hurt = 2;
Health -= Wscript.Dammage;
Debug.Log("Enemey Hit");
yield WaitForSeconds(DammageDelay);
Hurt = 1;
}
Its perfectly acceptable to send parameters that are not received in SendMessage. Check out the [documentation][1]. > The receiving method can choose to ignore the argument by having zero parameters. [1]: http://docs.unity3d.com/ScriptReference/GameObject.SendMessage.html
– Kiwasi