face-entity
function Script:FacePlayer()
    local pos1 = self.entity:GetPosition(true)
    local pos2 = self.Player:GetPosition(true)
    local v = Vec2()
    v.y = pos1.x - pos2.x
    v.x = pos1.z - pos2.z

    local angle = Math:ATan2(v.y, v.x)
    self.entity:SetRotation(0, angle + 180, 0)
end
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License