Game Development Reference
In-Depth Information
Updating an agent orientation
Changing the orientation of an agent is similar to setting a position vector, except that a for-
ward vector must be provided. As the sandbox simulates humanoid agents, the physics sim-
ulation locks the orientation of the agent to force agents upright. When setting a forward
vector of an agent, the sandbox assumes that the y axis is considered the up axis within the
sandbox:
local forwardDirection = Vector.new(
xDirection, 0, zDirection);
Agent.SetForward(agent, forwardDirection);
Search WWH ::




Custom Search