FaceNearestPC

From NWN Lexicon
Jump to navigationJump to search



FaceNearestPC()

Causes an NPC to face the nearest visible PC.

Description

Causes an NPC to face the nearest visible PC.



Requirements

#include " nw_i0_2q4luskan "

Version

1.22

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);
}

See Also



 author: Tom Cassiotis