3d pan and zoom

for my first bge project, I’ve been working on a script(s) that allows a sort of 3d pan. it is activated by the right click(holding), the pointer disappears, and after rotating the camera a bit by moving the mouse like 2d pan, releasing the right click will make the pointer appear and go back to the position where pan was activated.

the camera is parented to an empty, that empty is parented to another, the two empties spin on x and z axis respectively using ipo, much like in blendezo’s 3rd person template…

the problem is that after making a few full rotations on either axes, it stops and I can’t make it jump from, say 50 to -50, to make it loop forever.

also, I got the ipo actuator to work in python, but I don’t really understand how and it gives an error in the console

here’s the blend file: 3d pan.blend (156 KB)