Positioning the camera behind the player

Currently I’m using the roaming ralph code. I’ve reparented the camera to ralph, but I can’t get the camera to be positioned behind him. Right now it is looking at him from the back right.


I’ve tried changing the numbers in the second line of code, but just can’t get the camera to go behind him. Could anyone explain to me the second line, or offer any suggestions on how to fix this? Thanks!

Once your camera has been parented to ralph, its local coordinates become relative to ralph. Thus, as far as your camera is concerned, ralph is at (0, 0, 0), the point (10, 0, 0) is 10 feet to ralph’s right, the point (0, 10, 0) is 10 feet in front of ralph, the point (0, 0, 10) is 10 feet above ralph–and the point (0, -10, 0) is always 10 feet behind ralph.

base.camera.setPos(0, -10, 0)


Awesome, thanks!!