- Home /
Question by
insanityinteractive · Dec 01, 2011 at 07:06 AM ·
damagesystemhealth
Health/Damage system
Hey, i was using Dastardly Banana's enemy health counter on the player, and i want it to do damage when the gameobject hits the player. Thanks.
Comment
Simple- write a script that decreases the player's health when it detects a collision!
Sorry i need a little more than that, like how do i add the "oncollision"
Something along the lines of: on collision{ decrease health = 20 }
Read the documentation. (all of it.) It's there to help!
Answer by FLASHDENMARK · Dec 01, 2011 at 08:01 AM
function OnCollisionEnter(hit : Collision){
//Do insane stuff right here!
}
For more information click here.
Your answer
Follow this Question
Related Questions
Health Regen Stop After Damage 1 Answer
how do i make a script that calculate how much damage did i loss 1 Answer
For loop on collision (two hit kill) 2 Answers
Fire Damage 2.0 1 Answer
Damage not triggering in build 1 Answer