Did you so a search in forum ? resourche ? aum's ?
if so then you missed this one :
[codefunction player_follower();
action players_code() // attach this action to your player model
{
var movement_speed = 20;
VECTOR temp;
set (my, INVISIBLE);
player = my;
ent_create("guard.mdl", nullvector, player_follower);
while (1)
{
my.pan -= 7 * mouse_force.x * time_step;
vec_set (temp.x, my.x);
temp.z -= 10000;
temp.z = 0;
temp.x = movement_speed * (key_w - key_s) * time_step;
temp.y = movement_speed * (key_a - key_d) * 0.6 * time_step;
c_move (my, temp.x, nullvector, IGNORE_PASSABLE | GLIDE);
camera.x = my.x;
camera.y = my.y;
camera.z = my.z + 50;
camera.pan = my.pan;
camera.tilt += 5 * mouse_force.y * time_step;
wait (1);
}
}
function player_follower()
{
var walk_percentage;
while (1)
{
// play with the numerical values; they give the xyz offset of the follower in relation with the player
vec_set(my.x, vector(150, -60, 0));
vec_rotate(my.x, you.pan);
vec_add(my.x, you.x);
my.pan = you.pan;
ent_animate(my, "walk", walk_percentage, ANM_CYCLE); // play the "stand" aka idle animation
walk_percentage += 5 * (key_w - key_s) * time_step; // increase walk_percentage only if the player is moving
wait (1);
}
}
][/code]]
From here you have to study this code make changes and
make it do what you really want
![wink wink](/ubb7/images/graemlins/default_dark/wink.gif)
good luck
![laugh laugh](/ubb7/images/graemlins/default_dark/laugh.gif)