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?

Last edited by silencer; 04/14/09 20:15.

AMD 64 x2 4400+ 2048mb DDR3200 NVidia 6800GS 256mb Soundblaster Audigy 2 A7 Commercial 7.07