Issue updating NavMesh code and Agent.

In my RTS project, my units no longer move after updating the unity API:

  1. I had to update my “agent” to use “.isStopped” instead of “.resume()”
  2. I had to update my “NavMeshAgent” to “UnityEngine.AI.NavMeshAgent”

Can anyone figure out why this doesn’t work anymore?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RightClickNavigation : Interaction {

    public float RelaxDistance = 5;

    private UnityEngine.AI.NavMeshAgent agent;
    private Vector3 target = Vector3.zero;
    private bool selected = false;
    private bool isActive = false;

    public override void Deselect()
    {
        selected = false;
    }

    public override void Select()
    {
        selected = true;
    }

    public void SendToTarget()
    {
        agent.SetDestination(target);
        agent.isStopped = false;
        isActive = true;
    }


    // Use this for initialization
    void Start () {
        agent = GetComponent<UnityEngine.AI.NavMeshAgent>();
		
	}
	
	// Update is called once per frame
	void Update () {
        if (selected && Input.GetMouseButtonDown(1))
        {
            var tempTarget = RtsManager.Current.ScreenPointToMapPosition(Input.mousePosition);
            if (tempTarget.HasValue)
            {
                target = tempTarget.Value;
                SendToTarget();
            }
        }

        if (isActive && Vector3.Distance(target, transform.position) < RelaxDistance)
        {
            agent.isStopped = true;
            isActive = false;
        }
		
	}
}

Good day. I recommend you to test 1 by 1 each step. Make a simple nav mesh agent script to test. Set destination, change velocity, acceleration, etc…
Once yo make it move, come to your code again

And i recommend to add at the beggining of the script

using UnityEngine.AI

So NavMeshAgebt will be a class that you can use directly.

Byeee