Put chaseCam behind the player

Hi all,

I see in the thread “Request: ChaseCamera rotation.” that I can move the camera with the method setDefaultHorizontalRotation(). I’d like to know how to put the camera behind the player using this method (the camera is always looking the player, but doesn’t turn with the player).

Thanks a lot!


well, usually you do it the other way around, you rotate the player according to the camera direction.

you’ll have the same result, a lot less of complicated math stuff, and a lot less of head aches …

for example :



look at TestWalkingChar in the test repository, it’s how it’s done

nehon, thanks for your reply.

What I really like to do is to give the liberty to the user to move the camera and the player separated (yes, the camera always follow the player, but you can turn the camera without turning the player and vice versa), and when you stop moving or turning, the camera will move behind the user automatically.

I try to do:


Quaternion q = player.getWorldRotation();



But don’t work. It seems that I can’t move the “cam” object, just the “chaseCam” one.



oh…there is something like this implemented, but the other way around : the camera goes in the player’s trail when he moves and stops when he stops.

there is no easy way to do this with the chaseCam. I’ll see what i can do

Ok, thanks.

If I can do anything to help, just let me know.