I started making a small flight sim game:
action plane1_act
{
my.health = 100;
while(1)
{
//controls
my.roll += (key_d - key_a) * 2 * time;
my.tilt += (key_s - key_w) * 2 * time;
//movement
c_move(my,vector(32 * time,0,0),nullvector,ignore_passable);
//camera
vec_set(camera.x,vector(-1900,-1900,1300));//x,y,z,offsets
vec_rotate(camera.x,vector(my.pan,0,0));//based on pan AND tilt
vec_add(camera.x,my.x);
vec_set(temp.x,my.x);
vec_sub(temp.x, camera.x);
vec_to_angle(camera.pan,temp);
wait(1);
}
}
Very basic. However, when I roll to the side and then tilt up or down, my plane (no matter the roll angle) tilts straight up and down.
I know I solved this before, but I can't find the answer.