ARLookAtPos

From Blue Mars Developer Guidebook

Jump to: navigation, search
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
Problems with this wiki page? Contact us either by: Support Email or Support Ticket System

Blue Mars Guidebook Privacy Policy
Blue Mars Guidebook Community Guidelines

Personal tools