• Get the angle between two entities?
    1 replies, posted
Just finished Calc III and this of all things is driving me a lil' crazy. I feel like I'm vastly overcomplicating things. Basically, I have a hovering enemy. I just need him to look down at whatever he's targeting. Is there a simple function for this that I"m just unable to find?
Nevermind, seem to have fixed it myself. Works partially (Using VJ Base) local ang = self:GetAngles(); local enemyPos = self:GetEnemy():GetPos() local myPos = self:GetPos() local distanceXY = math.Distance(enemyPos.x, enemyPos.y, myPos.x, myPos.y) local lookAt = math.atan(distanceXY/(myPos.z-enemyPos.z)) ang.x = 90-math.deg(lookAt) self:SetAngles(ang) PrintMessage( 3, ang.x)
Sorry, you need to Log In to post a reply to this thread.