i m doing a 3rd person game.
my char basic movement use something like the kingdom of heart movenent control
i wanna to bind q key to lock on enemy and rotate my character towards the enemy and my bullet move towards the target. if the button q press one more time it will lock another enemy. and when z is press to unlock enemy. something like devil may cry. code below is my bullet moving function

Code:

function bullet_event()
{
if(EVENT_TYPE == event_block)
{
my.skill47=1;
ent_playsound(me,b_bounce,100);
vec_to_angle (my.pan, bounce); // bounce direction
my.event = remove_bullets;




}
}

function turn_towards_target()
{
// get the direction from the entity MY to the TARGET
vec_set(temp,TARGET.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp); // now MY looks at TARGET
}



function spawn_bullet()
{

snd_play (playershot_snd, 70, 0);
Ent_create("bullet.mdl",player_weapon.x,bullet_move);
}




Last edited by alex5801; 12/14/06 13:42.