They use the same approach, but in terms of implementation, the name of the member variables change, as well as some computations in the first half of the GetSteering function:
- First, implement the Arrive behavior with its member variables to define the radius for stopping (target) and slowing down:
using UnityEngine; using System.Collections; public class Arrive : AgentBehaviour { public float targetRadius; public float slowRadius; public float timeToTarget = 0.1f; }
- Create the GetSteering function:
public override Steering GetSteering() { // code in next steps }
- Define the first half of the GetSteering function, in which we compute the desired speed depending on the distance from the target according to the radii ...