Thx, for your code! smile
But i want to use the pan direction of the entity and the player position to become a horizontal animation.

if the differenz = 180°(player is behind the enemy), the turn animation is on 100%

if the differenz = 0°(player is infront of him), the turn animation is 0%

the problem is, i have no idea, how i get this differenz. frown

This is my version of the "look-at-the-cube-test"
The vertical look direction works fine, but the horizontal is major improvised and ugly.
I need a smooth animation, who works in both directions!(turn holzo's pan to 180° and you know what i mean ....)

Code:
#include <acknex.h>
#include <default.c>

action holzo()
{
	VECTOR temp;
	var verti_direction;
	var hori_direction;
	while(1)
	{
		vec_set (temp.x, player.x);
		vec_sub (temp.x, my.x);
		vec_to_angle (my.skill50, temp);
//		hori_direction = ???
		verti_direction = ((my.skill51 + 90)/180) * 100;
		my.skill10 += 5*time_step;
		ent_animate(me, "stand", my.skill10, ANM_CYCLE);
		ent_animate(my, "direction", verti_direction, ANM_ADD);
		
		////////////////////// useless part //////////////////////
		if(player.x < my.x) hori_direction = 0;
		else hori_direction = 100;
		//////////////////////////////////////////////////////////
		
		ent_animate(my, "ignore", hori_direction, ANM_ADD);
		
		wait(1);
	}
}

action justsid()
{
	player = me;
	while(me)
	{
		my.z += 20*(key_w-key_s)*time_step;
		my.x -= 15*(key_a-key_d)*time_step;
		wait(1);
	}
}

void main(){
	
	wait(1);
	
	warn_level = 0;
	mouse_mode = 4;
	
	level_load(NULL);
	ent_create(CUBE_MDL, vector(0, 500, 0), justsid);
	ent_create("holzo.mdl", vector(0, 500, 0), holzo);
	camera.pan = 90;
	
}



control the cube with "w-a-s-d"

Hope i say nothing wrong....
OTTER


Be my UBB-Buddy, without any reason!