Hello !
This is method how I use to make the NPC rotate towards the enemy, but it's boring and bad.
PHP Code:
pev(ent, pev_origin, vOrigin)
pev(victim, pev_origin, vVicOrigin)
xs_vec_sub(vVicOrigin, vOrigin, vVector)
// Convert vector to angles.
vector_to_angle(vVector, vAngles)
vAngles[0] = 0.0
vAngles[2] = 0.0
pev(ent, pev_angles, vAngles)
I tried to make this entity rotate but at a certain speed towards some entity like NPCs in Half-Life.It rotates from the near direction of the enemy, for example, if the enemy is on the right side of an entity, the entity will rotate towards the right direction.
Thanks in advance
__________________