Game Development Reference
In-Depth Information
AgentUtilities_ApplyForce(
agent, seekForce, deltaTimeInSeconds);
AgentUtilities_ClampHorizontalSpeed(agent);
-- Draw debug information for target and target radius.
Core.DrawCircle(
destination, targetRadius, Vector.new(1, 0, 0));
Core.DrawLine(position, destination, Vector.new(0, 1,
0));
end
As the pursuing agent needs an enemy, we create the agent in the sandbox after our seek-
ing agent is already initialized:
Sandbox.lua :
function Sandbox_Initialize(sandbox)
...
Sandbox.CreateAgent(sandbox, "SeekingAgent.lua");
Sandbox.CreateAgent(sandbox, "PursuingAgent.lua");
end
Running the sandbox, we'll now have a pursing agent chasing after our seeking agent.
Search WWH ::




Custom Search