Rotating a camera around a still ball (mini golf aiming)

I’m making a mini golf game and I’m completely finished apart from this one detail. Once the ball is shot I want to be able to rotate the camera around the ball to see the hole, but right now the camera is stuck on a single axis right behind the ball. I used thismethod to parent the camera to the ball to eliminate camera roll.

I’m not looking for a 360 animation, just to be able to reposition the camera while maintaining centering on the ball

Here’s my blend file if you want to take a look!

Can you re-upload your .blend to Google warned me that your file’s too big for a virus scan, so I’m a bit nervous about downloading it.

Max file size is 30mb, mine is 47 :frowning: I’ll see if I can find another host

Is megaupload ok?

Add a empty, put it at the balls location

Vertex parent the empty to the ball

now parent the camera to the empty,

Rotating the empty should rotate the camera without effecting the ball.

if vertex parent gives you a offset you don’t like

you can always use

inside empty


import bge
cont = bge.logic.getCurrentScene()
own = cont.owner

if 'Ball' not in own:
    own.worldPosition = own['Ball'].worldPosition

thank you!! that worked perfectly

I was using empties but not in the correct way, much appreciated!

an intresting note, you can use the camera local Z axis to push your ball.


Negative force, because camera forward is -Z

to get access to a camera, you have a few options.


and own.scene.objects[‘NameOfCamera’]