ARLookAtPos
From Blue Mars Developer Guidebook
There are security restrictions on this article
|
|
This is an Avatar Reality Utilities function.
Function
- ARLookAtPos(entity, position to aim entity at)
- Orient entity to point at position
Code
This convenience function just takes the vector from the entity position to the target position, using the math utility function DifferenceVectors, and then aims the entity at that position, using the entity function SetWorldVDir. See also GetWorldPos.
function ARLookAtPos(entity,pos) local aim = DifferenceVectors(pos,entity:GetWorldPos()); entity:SetWorldVDir(aim); end

