Game Development Reference
In-Depth Information
Orientation
Whenever you need to return the orientation of an agent, it's easiest to use the forward vec-
tor that usually represents the direction of movement of an agent. Both the left and up vec-
tors of orientation are available as well. Whenever you need to change an agent's direction,
simply set its forward vector.
The forward axis
To access and set the forward vector of our agents, we can use the built-in GetForward
and SetForward helper functions.
local forwardVector = agent:GetForward();
Agent.SetForward(agent, forwardVector);
The left axis
We can also access the left orientation vector using the GetLeft helper function.
local leftVector = agent:GetLeft();
The up axis
Accessing the up orientation vector is similarly provided by a GetUp helper function.
local upVector = agent:GetUp();
Search WWH ::




Custom Search