Formula question. Getting an entity to point at vector

This is probably a really wanted formula. So here I am asking for it.

I have an entity. I want it to face towards a players eyetrace.hitpos…

What is the formula for this? Thanks.

You could use:

PlayerSelectSpawn requires a point-entity to be returned, you could use the point-entity to accomplish this, set position of the point entity then call face towards.

Or, you could do some math:

There’s also this for Nextbots( ? ):

local mt = FindMetaTable(“Entity”)
function mt:PointAtVec(vec)
local dir = vec - self:GetPos()
Untested. Use as ent:PointAtVec(pos)

EDIT: Now tested. Works.

Thanks this worked for my uses.