Ball Game camera

I am trying to make a little maze type game where you control a ball to get around the maze. I have the camera following the ball thr right way but I dont know how to make the camera rotate around the ball.How could i make the camera rotate around the ball by using the mouse tocontrol the camera?

Hi,
Personally I would use the MouseLook script here
http://www.tutorialsforblender3d.com/Game_Engine/MouseLook/MouseLook_First_2.html
And apply it to the setup I made here,
http://blenderartists.org/forum/showpost.php?p=1443004&postcount=4

I was going to upload an example but the attachment button is missing,
So if you need any help let me know.

HI there!

Using the whole arsenal of Blender physics to do the task is way unnecessary. I think… I dont have great experience with game-making by using Blender though. I’m more interested in animations, vids making… Soooo… The idea with the Empty object and locking the cam to follow it is well known one. You’d need to lock the Empty to the Ball too though :wink: In the case - the cam to follow JUST one object - it could be implemented even more simple: lock the cam to the ball itself. I mean in terms of appropriate location/distance. Then rotate the cam with a radius = that distance. Some scripting will be needed and it will work with animations, Im not sure for the gaming engine but you may try or adapt something…

Suppose, p1 = Ball.loc and p2 = Cam.loc… (p2,p1) is a vector to the direction of which you need your cam to point so that you always see your Ball. Any locations of the cam lie on a sphere with a center p2. So your script needs to re-calculate the cam location based on the 3D-angle you wanna use. After re-location, you’d need to re-calculate the direction.

Regards,