Camera - default positions.

Hello guys, I’m having some problems here. To explain what I want simply:

I want the user to be able to rotate the camera around the player object with the numPad, 
or the mouse (don't really mind which, an answer for both would be awesome). But, when they 
press a certain key (F1 for example), I want the camera to revert to it's origional position.

Any idea how I’d go about this? Also, it would be cool to have the camera rotating around an empty or something which is parented to the player object. Cheers, and I hope I’m making sense.


Parent the camera to the empty and rotate the empty when a numpad key is pressed, and you will need python for the mouse thing)

For reverting to the origional position, maybe use an empty and assign python variables to its position in the scene, when a key is pressed, the camera would execute something like cam.setPosition(GameLogic.emptyLoc)

For the getting of the location, a python script line would be like this

GameLogic.emptyLoc = empty.getPosition()

Is there any way to get the rotation?

In resetting position, I’m meaning the position of the camera in it’s orbit around the player. For example, the default position is at the back of the player. The user rotates to face the front of the player, but then presses the F1 key. This should send the camera back to the ‘default’ position, which in this case would be behind the camera. Hope that was clear.

Thanks for the fast response though CD!

There’s GetOrientation() for getting the rotation of the camera but if you want to manipulate it directly you may have to know matrices and I could never get how to use those things.

I’m not but if you saying you want it to rotate around the player but still be facing it you could just use the track actuator while it rotates.

Gah… Okay, thanks guys. I had an idea, which is to use an IPO, will let you chaps know if that works!