i making plataform game and want to make a basic script that will be used to every enemy ,that look like this
if conlisionSensor.positive: #detect player atack
timer['time'] = 0
own.color = [10,m,m,1] #make the enemy red
own['hp'] += -1 #receive damage
elif time%0.15==0:
own.color = [1,1,1,1] #return color to normal
if hp < 1 :
cont.activate(destroy)
I want to make all children to change colors when the owner receive damage without call each one of then because i want the script to run for each of enemys without modification.