I wrote a script to change an Edit Object actuator track object based on which object it is near.
Here is the script, pretty much straight off the template:
import bge def main(): cont = bge.logic.getCurrentController() own = cont.owner sens = cont.sensors['NearBad'] actu = cont.actuators['Attack'] if sens.positive: actu.track_object = sens.hitObject cont.activate(actu) else: cont.deactivate(actu) main()
actu.track_object = sens.hitObject is the line in question.
I wrote that based on what I think it should be, but what is the right syntax? How do I really do that?
Disclaimer: Although I work with BGE all the time, I have no coding experience at all.