SetFacingPoint
From NWN Lexicon
Jump to navigationJump to search
SetFacingPoint(vector)
Sets the object to face the direction of a vector.
Parameters
vTarget
The vector to have the object face.
Description
Cause the caller to face vTarget.
Functions GetPosition and GetPositionFromLocation will provide vectors that can be used as parameters to this function.
Version
1.61
Example
//Make the caller face oTarget
void SetFacingObject(object oTarget)
{
vector vFace=GetPosition(oTarget);
SetFacingPoint(vFace);
}
void main()
{
//Example of use: Caller faces the nearest PC:
object oPC=GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
if (GetIsObjectValid(oPC)) SetFacingObject(oPC);
}
void SetFacingObject(object oTarget)
{
vector vFace=GetPosition(oTarget);
SetFacingPoint(vFace);
}
void main()
{
//Example of use: Caller faces the nearest PC:
object oPC=GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
if (GetIsObjectValid(oPC)) SetFacingObject(oPC);
}
See Also
functions: |
author: Tom Cassiotis, editor: Lilac Soul