touch or collosion?

hey all i want it so when my sword hits an bad guy he dies then goes away how would i go about this with logic bricks? please help


use collision

how do i aply it so it will only do the action if it hits the sword

You’re probably going to have to make those decisions using procedural (Python…) logic. These triggering mechanisms basically exist to give your custom-code the opportunity to execute in what might (or might not) be an appropriate-for-your-game situation.

There might be a great many calls where your logic says, “Oops, not a sword. Do nothing.”

umm, not to burst your bubble here, but the answer is that you will need python

because, [well, last I heard], armature deformed objects don’t have their bounds [or collision faces] deformed. so, if the sword is a bone in an armature it will not really be able to hit anything

so, what I guess you would need to do is have a property of your object to say if you are swinging your sword. the enemy has a collision or touch sensor for this property, connected to a python script which checks that property to see if you are swinging the sword. if so, health is subtracted [or simply the enemy is killed]