third person camera question

i am having difficulty understanding how to place camera/cameras for having a third person view setup.
currently i have a single camera running the following code

import bge
from bge import render
scene = g.getCurrentScene()
co = bge.logic.getCurrentController()
o= co.owner

mouse = co.sensors["Mouse"]

Cube= scene.objects["player"]
cameraTarget= scene.objects["cameraTarget"]

#####mouse movement

#movSpeed = 0.3
rotSpeed = (0.005, 0.005)

# mouse look
x = (render.getWindowWidth() / 2 - mouse.position[0])
y = -(render.getWindowHeight() / 2 - mouse.position[1])

Cube.applyRotation((0 , 0, int(x) * rotSpeed[0]), False)
cameraTarget.applyRotation((int(y) * rotSpeed[1], 0, 0), True)
render.setMousePosition(int(render.getWindowWidth() / 2), int(render.getWindowHeight() / 2))

but what this does is just help me steer my player with mouse but doesn’t follow him.
what am i doing wrong here?

Look at this example, maybe it could help you.
What about vertex parent the camera?

Have also a look at this setup. The tilting of the 3rd Person Camera is coordinated by tilting the object that has the 1st Person Camera parented to it. ‘C’ to switch Cameras.

Edit: There was no use for the two empties, so I deleted them. Sorry for the confusion.


ShootEnemy46.blend (112 KB)

i solved my problem…thnx for help