Disable and Enable NavMesh Agent Unable to Move to Destination

Hi,

I’m trying to develop a 3D platformer. One of the powerups allows the user to sit back while a NavMesh Agent takes them up a few platforms.

If I start the NavMesh Agent in the scene and allow it to move to it’s goal destination, it does so perfectly. However, if I only instantiate (or even enable it if it’s already instantiated) during gameplay (as opposed to the beginning), it does not move to its goal destination.

Further, if it is going from the beginning and I disable and reenable it, it also does not work correctly and does not move to its goal destination.

Here is the code to get it to move to its goal destination:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using UnityEngine.AI;
using UnityStandardAssets.Characters.ThirdPerson; 

public class MoveTo : MonoBehaviour {
	
	public ThirdPersonCharacter character;
	NavMeshAgent agent;
	public indexFinder[] platforms;


	void Start () {
		
		platforms = FindObjectsOfType<indexFinder>().OrderBy( go => go.name ).ToArray();
		agent = GetComponent<NavMeshAgent>();
		agent.destination = platforms[platforms.Length-1].transform.position; 
		Debug.Log (agent.destination);
		agent.updateRotation = false;
	}

	void Update(){
		if (agent.remainingDistance > agent.stoppingDistance) {
			character.Move (agent.desiredVelocity, false, true);
		} else {
			character.Move (Vector3.zero, false, false);
		}
	}
}

Any help would be hugely appreciated.
Thanks

Even i have the same issue.If anyone finds a fix please inform.