LookAtPos
Revision as of 16:58, 29 October 2024 by Habi (talk | contribs) (Created page with "{{Welcome| desc=This function sets the angle of npc such that it looks at the position given| params=<syntaxhighlight lang="lua"> pos</syntaxhighlight> <poem>::pos : The Vector position to which npc must look</poem>| example= The following code makes to look at player with ID 0. <source lang="lua"> LookAtPos(GetPlayerPos(0))</source>| relfuncs=*LookAtPlayer| retvals=true on success and false on failure (npc not spawned or npc is in vehicle.| }}")
Description:
This function sets the angle of npc such that it looks at the position given
Parameters:
pos
pos : The Vector position to which npc must look
Return Values:
true on success and false on failure (npc not spawned or npc is in vehicle.
Example
The following code makes to look at player with ID 0.
LookAtPos(GetPlayerPos(0))
Related Functions
The following functions may be helpful as they relate to this function in one way or another.