Hi,

i am trying to make a gun shot some balls and it works ok when the player and gun are stopped:

Code:

function create_balls()
{
proc_kill(4);
vec_for_vertex (temp.x, weapon1, 1465);
ent_create (ball_mdl, temp.x, move_balls);
}
}

function move_balls()
{
var ball_speed;
my.pan = camera.pan;
my.tilt = camera.tilt;
ball_speed.x = 50 * time_step;
ball_speed.y = 0;
ball_speed.z = 10 * time_step;
while (my != null)
{
c_move (my, ball_speed, nullvector, ignore_passable);
ball_speed.z -= 3 * time_step;
wait (1);
}
}





The problem is: when the player and gun are moving, when camera.tilt its higher than zero the ball goes up and does not assume the correct tilt.
Also it happens when camera.tilt is less than zero, goes too much down the ball.

What´s the problem here?
Thanks.