Either grab the position of a head vertex with vec_for_vertex and set camera.z or do something as follows:

var camera_bob = 0;
...
camera_bob += player_speed*time_step; // player_speed != 0 if player is moving
camera_bob %= 360;
camera.z = player.z+player.max_z+8*sinv(camera_bob);

Last edited by Superku; 01/29/12 02:44.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends