hi i am making a hack slash game
and i could not find a way to do damage to the enemy’s
i have a sword with a trigger that i animated.
This is howe it works
swords goes down>colides with other object>object is destroyed.
this is howe i want it to work:
sword goes down> colides with other object> object recieves some sort of message to take X amount of dammage> healt goes down with X.
can some one help me with it?
i am not a scripter att all. So it would be realy nice if some one. could write a example of that script. Or tell me where i have to search at. unity3d.com.
thnx for your time and i hope some one can help me
thnx i already got a script wich has a targeting system and all but the thing where i am looking for is.
when i swing my sword the collider(trigger) hits a object.
is there any way that it can send a message to the object wich it collided with. that when it collides the objects has to take dammage.
and than preferly that i can change the dammage ratio for each weapon.
this also means that when i swing my weapon. and there are more than 1 objects in the way of my weapon. all the objects take dammage
this is what i got now(i don’t know exactly what it means but i know what it does )
// Destroy everything that enters the trigger
function OnTriggerEnter (other : Collider) {
Destroy(other.gameObject);
}