so, I want to have my camera follow a player, but because the model tilts and rolls the camera doesnt follow the player properly. my code works for characters that dont rotate around does anyone know how i can have it work for rolling, "ball" entities?
here is a portion of my code, if you really need it.
function check_view()
{
my = player;
var dist_trace; //variable to store trace;
trace_mode = ignore_me + ignore_passable;
dist_trace = trace(player.x,camera.x);
if(dist_trace == 0){return; } //if there is no obstruction do nothing
if(dist_trace < cam_tdistance)
{
dist_trace -= 5; //move out from wall;
cam_pdistance = cos(cam_tilt)*dist_trace;
camera.x = player.x - cos(cam_angle)*cam_pdistance; //keep the camera within the circle around the player
camera.y = player.y- sin(cam_angle)*;
camera.z = player.z+ sin(cam_tilt)*dist_trace;
camera.pan =0; //cam_angle + player.pan;
}
}