I’ve read through the links you gave me, I think I understand the concept of how this works.
However, I’m not sure how to apply it to my set up. I’ve used a script that your blend file offered “S2A.blend” But then the my set-up stopped working. (I know, I did something wrong.)
I set it back to my original set-up so you can see how it currently functions.
And I put a text in there explaining the current controls, and what I’m trying to achieve.
I’m not 100% sure what exactly you want. But here is what I did:
you can deactivate the False Pulse at all message sensors. Diactivatinf Property actuators all the time is waste of processing time even if it is not much ;).
the python file should be named S2A.py. Otherwise the python controllers can’t find it.
I added following logic to your focal point object:
a) A near sensor: property “track” distance 10 reset 15 no Pulse
b) Python Module controller S2A.closestHitObjectToObject
connected a) with b) and your camera actuator.
Keep in mind, the actuator will not be deactivated by this method. You will need other controllers to do that (message sensor -> AND -> Camera actuator).
I hope it helps
[edit]:
you can also add the near sensor to the armature and connect it with the focal point controlle via inter object connection (select both objects - connect the logic blocks)