Hi,
doing my first steps with the designer (incl Movement and A* PathfindingProject). I added to the first example (agent is looking for the red cube) a patrol task (with 5 waypoints, Speed = 10). But I get a NullRefException agent.maxSpeed = speed.Value; in the IAstarAIMovement script on OnStart method. What's wrong?
agent is null
public abstract class IAstarAIMovement : Movement
{
public override void OnAwake()
{
agent = gameObject.GetComponent<IAstarAI>();
if (agent == null)
Debug.Log("missing");
}
doing my first steps with the designer (incl Movement and A* PathfindingProject). I added to the first example (agent is looking for the red cube) a patrol task (with 5 waypoints, Speed = 10). But I get a NullRefException agent.maxSpeed = speed.Value; in the IAstarAIMovement script on OnStart method. What's wrong?
agent is null
public abstract class IAstarAIMovement : Movement
{
public override void OnAwake()
{
agent = gameObject.GetComponent<IAstarAI>();
if (agent == null)
Debug.Log("missing");
}