4
$\begingroup$

I have trouble with damaging system. I have made a damage system using property(animation property to damage at specific frame) and ray detecting "dmg" property connected to enemy object hp removal actuator with enemy having "dmg" property. When i test on 1 (original) enemy, it works but when i want to make enemies appear via add object actuator it causes only the original object take damage.i tried to put the original on other layer but still didnt do anything. any idea how to make it work?

the system

would also accept a new system for damage

$\endgroup$
3
$\begingroup$

i have solved it by myself by learning python and making new system, using this script. anyway thx for answers...

from bge import logic as GameLogic
c = GameLogic.getCurrentController()
own = c.owner

enemydetect = c.sensors["enemydetect"]
punchright = c.sensors["punchright"]
if punchright.positive and enemydetect.positive:


    obj = enemydetect.hitObject

    obj["HP"] = obj["HP"] - own["RightDamage"]
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.