A* IAstarAI agent not found (NullReferenceException)

MagicTimm

Member
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");
}
 
I think I didn't used the wrong Patrol Task. With the one from A*Pathfinding it works.
Does it mean that if I can choose between Standard and A* I have to choose the A* Task?
 
Top