1 - beginloop
2 - Move your character
locally, and rotate it
locally using controls.
3 - place and rotate your camera exactly as your character is, using GetObjectX/Y/Z(character), getobjectangleX/Y/Z(character)
4 - Move back
locally your camera using MoveCameraLocalZ(1,-backdistance)
5 - optionally move up your camera using MoveCameraLocalY(1,cameraWantedHeight)
6 - optionally SetCameraLookAt(1,GetObjectX(character),GetObjectY(character),GetObjectZ(character),0) to focus your character
7 - sync()
8 - endloop
should do the trick