This is my new tutorial on camera control in BGE with Python. This tutorial is a spiritual child of my previous tutorial named “Rotating Camera Around an Object” which will be used as a basis for this tutorial :
In this new tutorial we are going to add an advanced function to the camera. Whenever an obstacle is placed between the tracked object and the camera, then the camera will zoom in in order to be placed just in front of the obstacle, thus allowing us not to lose sight of the tracked object. When the obstacle isn’t blocking the view anymore, e.g. by rotating the camera, then the camera will resume its initial distance from the tracked object.
For this tutorial, basic knowledge of BGE python is required.
I hope you’ll find this tutorial useful and I’m waiting for your comments, suggestions or questions.
Tutorial can be found HERE.