FaceNearestPC

From NWN Lexicon
Revision as of 00:23, 26 August 2012 by Dood (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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