Okay, I've got it working, but I've got exactly the same problem as SpaceJim! The model I've attached (block.mdl) has a certain lag behind the movement of the "parent" entity... I assume this is because of the wait(1) in my vertices() function, but can't think of another way to do it. Has anyone got any ideas?
function vertices(vertex) // updates the position of the vertex...
{
while(1)
{
ent_vertex(position,vertex);
wait(1);
}
}
function blow_detector //just checks it's in third person view and if it is then the new object copies the pan rotation of its creator
{
while(1)
{
if (you == player && person_3rd == 0) {
my.invisible = on;
} else {
my.invisible = off;
}
vec_set(my.x,position);
vec_set(my.pan,you.pan);
wait(1);
}
}
Then this is placed in the player entity (player_client in the office demo):
vertices(26);
create(<blow.mdl>,nullvector,blow_detector);
Thus in this example, the origin of block.mdl is copied to the position of vertex no. 26 in the player_client entity....
So has anybody got any ideas about the lag? Thanks, any suggestions much appreciated,
Ambit