I’m looking to use a radar sensor to damage any enemies which fall into it’s area during an attack. With a single enemy it would be quite simple. However when you have multiple enemies, it becomes much more difficult.
First I need to detect which enemies are hit. I believe the python function for this is sensor.getHitObject()? What happens if multiple enemies are hit at the same time?
Then, the life property of each of these enemies needs to be reduced. However the ones not hit should remain the same. This is the part I’m really wondering how to do.
Currently I’m thinking of linking the python script to every single monster, then comparing the getHitObject() with the function for returning an object’s name. When they match, the life reduction actuator is activated on that object.
Has anyone ever done anything like this before? Does anyone know a good method of doing it?