So I want to have an NPC to look at the player when the player passes within a certain vector distance, but I want them to track the player with a "neck" rotation, kind of like they do in Hitman.
So far I have:
Code:
ent_animate(me,NULL,0,0); // reset all bones
ent_animate(me,"idle",skill_1,ANM_CYCLE);
vec_set(temp,player.x);
vec_sub(temp,silver_surfer.x);
vec_to_angle(silver_surfer.pan,temp);
temp1 = silver_surfer.pan + 90;
if ((vec_dist(silver_surfer.x, player.x)) < 200) {
ent_bonerotate(me,"joint13",vector(temp1,0,0) ); // rotate neck bone
}
I thought the above would work, but it seems to be rotating the entire entity. What gives?