A Python ball and camera delema

How can one make a script that turns a camera to face in the direction a ball is rolling while in the game engine.

It’s a marble racing track, and I have several views, but I don’t want to use the mouse to control because I’m turning it into a screen-saver.

Why a script? Use the Edit Object> Track To Actuator.

It doesn’t really work because when it is supposed to be in first person view and the ball is rolling. The camera can’t stay with the ball unless it is parented to it. If parented, the camera spins with the ball. If vertex parented, it just stays straight. The camera actuator works a little better, but when the ball speeds up the camera falls behind.

You should put the max value down then.

It’s at zero, and can’t go down any further.

And it still falls behind? Thats odd… It should stay right in the center of the ball…

I guess that’s just how they made the actuator.

For the script, I was thinking about how possible it would be to convert the linear velocity of the ball into orientation coordinates for the camera.