Entity/SetEyeTarget

From Garry's Mod
Revision as of 06:37, 4 August 2014 by Microflash (Talk | contribs)
Jump to: navigation, search
 Entity:SetEyeTarget( )

Contents

Description

Sets the position an entity's eyes look toward.

Arguments

Vector pos

The world position the entity is looking toward.

Examples

Example

Makes an NPC (self) look into a nearby player's eyes.

for p, ply in pairs(player.GetAll()) do
    if(ply:EyePos():Distance(self:EyePos()) <= 60) then
        self:SetEyeTarget(ply:EyePos())
        break
    end
end


Personal tools
Navigation