hallo,

ich hab ma wiede n dickes problem für das ich keine lösung weiß.
und zwar habe ich meinem player ne bonerotation für den kopf gebaut das er wenn sich grad was in der nähe befindet er es ankucken soll. soweit funktioniert das auch. nur das problem ist, das die rotation nicht immer in die richtige richtung ist. das soll heißen, wenn ich rechts vor dem entity stehe und mich grade aus bewege so das der player nach links schauen muss geht es, aber in allen anderen situationen nicht. dann schut de player immer in die genau entgegengesetzte richtung oder macht gar nix.
ich denke das sich das problem darauf bezieht das der winkel den er sich drehen sich nicht auf den player.pan bezieht.
vllt hab ihr ja ne idee. ich schick euch mal den code.
Code:
function move_variable(variable_to_move,move_to_pos,move_speed) 
{
	if (variable_to_move == move_to_pos)
	{return(variable_to_move);}
	var moving_angle;
	moving_angle = variable_to_move - move_to_pos;
	if (moving_angle > 0) 
	{
		variable_to_move -= move_speed * time_step;
		if (variable_to_move - move_to_pos < 0)
		{
			variable_to_move = move_to_pos;
			return(variable_to_move);
		}
	}
	else
	{
		variable_to_move += move_speed * time_step;
		if (variable_to_move - move_to_pos > 0)
		{
			variable_to_move = move_to_pos;
			return(variable_to_move);
		}
	}
	return(variable_to_move);
}


function headbone_rotation()
{
	if ((scanned_entity != 0 || target_enemy != 0) && (camera_switch == 0))
	{
		ent_bonereset(my,"Bip01 Head");
		vec_set(temp.x,vector(scanned_entity.x,scanned_entity.y,scanned_entity.z ));
		vec_sub(temp.x,my.x);
		vec_to_angle(temp.pan,temp);
		vec_inverse(temp);
		result =  clamp(temp.pan,-90,90);
		result2 = clamp(temp.tilt,-8,20);
	}
	else
	{
		result = 0;
		result2 = 0;
	}

	
	head_bone_rotation.pan  = move_variable(head_bone_rotation.pan,result,35);
	head_bone_rotation.tilt = move_variable(head_bone_rotation.tilt,result2,35);
}


und an einer anderen stelle kommt halt noch das ent_bonerotate welches so aussieht : ent_bonerotate(my,"Bip01 Head",vector(head_bone_rotation.pan,head_bone_rotation.tilt,0));