Hey there,
I am having a hard time wrapping my mind around the proper way to set a bullet in front of a character's x axis and relative to their pan. I think I'm missing something simple and I am over complicating things... however if you could point me in the right direction it would be much appreciated! Here is what I'm working with....
//STATE == ATTACK
if(my.state ==2)
{
if(you.health <= 0) {my.state = 0;} vec_set(detect_box.x,vector(you.x,you.y,you.z+13));
// ent_animate(my,"attack",my.attack_percent,0);
my.attack_percent += 4*time_step;
// if(vec_to_angle(my.pan,vec_diff(NULL,you.x,my.x)) > 0) pXent_rotate(my,my.pan,vector(6*time_step,0,0));
//
if(my.attack_percent > 100)
{
ENTITY* bullet = ent_create("bullet.mdl",vector(my.x+100,my.y+13,my.z),move_bu;
bullet.x += 100*sin(my.pan+85);
bullet.y -= 100*cos(my.pan+85);
bullet.pan = my.pan+random(8);
bullet.tilt = head_bone.tilt;
ent_playsound(my,gunshot,500);
my.attack_percent =0;
wait(8);