Game Development Reference
In-Depth Information
Location
An agent's position is the center of the mass of its capsule representation within the physics
simulation. If you need to determine the origin of an agent, simply return its position and
subtract half its height from the
y
component of the position.
Position
To access and set the position of agents, we can use the
GetPosition
and
SetPosi-
tion
helper functions.
local positionVector = agent:GetPosition();
agent:SetPosition(positionVector);