SetFacingPoint

From NWN Lexicon



Contents

[edit] SetFacingPoint(vector)

Sets the object to face the direction of a vector.

void SetFacingPoint(
    vector vTarget
);

[edit] Parameters

vTarget

The vector to have the object face.


[edit] Description

Cause the caller to face vTarget.

Functions GetPosition and GetPositionFromLocation will provide vectors that can be used as parameters to this function.



[edit] Version

1.61

[edit] 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);
}

[edit] See Also

functions: 

SetFacing



 author: Tom Cassiotis, editor: Lilac Soul
 

Personal tools
Categories