Please Check the code and tell me why this isn't working?!

so I’m doing an artillery game, so where the shell hit near the tank I want it to be tracked (stop moving for 2 seconds) which it works fine, but the problem is it never moves again no matter how many attempts and codes I tried to assign the speed to 1f again it never works. here are the codes

the code on the shell which it hits and cause the tracking.

using UnityEngine;
using System.Collections;

public class Tracked : MonoBehaviour {

public float FarAreaEffectt;
private Transform explosion;
private Transform enemy;
public static bool wasTracked = false;

void Awake() {
	explosion = transform;
}
void OnCollisionEnter () {

	Collider[] colls = Physics.OverlapSphere (explosion.position, FarAreaEffectt);

	foreach(Collider col in colls) {

		if(col.CompareTag("Enemy")) {

			float distance = Vector3.Distance (col.transform.position, explosion.position);

				tracked (col.transform);
			Debug.Log ("enemy tracked");

			Invoke ("move", 2f);
			}
	}
}

void tracked(Transform enemy) {
	enemymove em = enemy.GetComponent<enemymove> ();
	em.speed = 0f;
}

void OnDrawGizmosSelected() {

	Gizmos.color = Color.red;
	Gizmos.DrawWireSphere (transform.position, FarAreaEffectt);
}

public void move(Transform enemy){
	Debug.Log ("invoked");
	enemymove e = enemy.GetComponent<enemymove> ();
	e.speed = 1f;
}

}

and here is the enemyMovement secript

using UnityEngine;

public class enemymove : MonoBehaviour {

public float speed;

private Transform target;
private int wavepointIndex = 0;

void Start () {

	target = WayPoints.points [0];
}

void Update() {
	

	Vector3 dir = target.position - transform.position;
	Quaternion rot = Quaternion.LookRotation (dir);

	transform.rotation = Quaternion.Slerp (transform.rotation, rot, speed * Time.deltaTime);

	transform.Translate (dir.normalized * speed * Time.deltaTime, Space.World);



	if (Vector3.Distance (transform.position, target.position) <= 0.4f) {

		GetNextWayPoint ();

	}
	}

void GetNextWayPoint() {

	if (wavepointIndex >= WayPoints.points.Length - 1) {

		speed = 0f;

		return;
	}

	wavepointIndex++;
	target = WayPoints.points [wavepointIndex];
}

}

so what I’m doing wrong?
is it because the shell get destroyed after the first time it get collides with the terrain and cause the tracking?

please help.

is it because the shell get destroyed after the first time it get collides with the terrain and cause the tracking?

Yes. If there is something destroying the object that has Invoke waiting to call a method on it, Invoke can’t finish its job. It’s much better to re-enable movement on the stuck object itself, because of that and because it makes more sense in a semantic way (as in why would the bullet free the vehicle again?).

Generally, in Unity, try to have things done by the objects that would do it in real life.

In code, this would mean that you add one or two methods to your vehicle script:

public void GetStuckFor(float time)
{
  StartCoroutine(StuckCoroutine(time));
}

private IEnumerator StuckCoroutine(float time)
{
  var originalSpeed = speed;
  speed = 0;

  yield return new WaitForSeconds(time);

  speed = originalSpeed;
}

I replaced Invoke with a coroutine here, which doesn’t rely on a string to identify the method to call. It also means that setting the speed, waiting, and setting it back to normal are all lines of one and the same method rather than splitting it into multiple methods, like with Invoke.

Of course, if you prefer to use Invoke, you can still do that here.

Either way, the bullet script just calls the new method now:

col.GetComponent<EnemyMove>().GetStuckFor(2f);

Note how I changed the class name to uppercase - you should do that too. Having lowercase class names will have you run into issues sooner or later.