FaceNearestPC

From NWN Lexicon



Contents

[edit] FaceNearestPC()

Causes an NPC to face the nearest visible PC.

[edit] Description

Causes an NPC to face the nearest visible PC.



[edit] Requirements

#include " nw_i0_2q4luskan "

[edit] Version

1.22

[edit] Example

// 1.24 source for this function
void FaceNearestPC()
{
    vector vFace = GetPosition(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN));
    SetFacingPoint(vFace);
}

[edit] See Also



 author: Tom Cassiotis
 

Personal tools
Categories