MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it.

I’ve a problema with my script, when player colision on contact with enemy it stop and says in console.

MissingReferenceException: The object of type ‘Transform’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Transform.get_position () (at C:/BuildAgent/work/d63dfc6385190b60/artifacts/MetroEditorExtensionsGenerated/UnityEngineTransform.cs:28)
FollowPlayerScript.Update () (at Assets/Scripts/FollowPlayerScript.cs:23)

This is my script.

using UnityEngine;
using System.Collections;

public class FollowPlayerScript : MonoBehaviour {
	public Transform Objetivo; 
	public float Velocidad= 3; 

	//Desactivado por ser utilizado en 2D
	//public float velocidadRotacion= 3; 

	public Transform myTransform; 
	
	void  Awake (){
		myTransform = transform; 
	}
	
	void  Start (){
		Objetivo = GameObject.FindWithTag("Player").transform; 
	}
	
	void  Update (){
		//rotacion para mirar al jugador
		myTransform.position = Vector2.MoveTowards(myTransform.position,Objetivo.position, Velocidad * Time.deltaTime);


		
		//Se mueve directo al jugador
		myTransform.position += myTransform.forward * Velocidad * Time.deltaTime;
		

	}
	

}

It appears that whatever “Objetivo” is, has been destroyed, and you as still trying to access it.

This may have have happened through an explicit GameObject.Destroy, or by moving between scenes. If the object that the “FollowPlayerScript” component has been placed on is persistent between scenes, it should clear it’s non-persistent references on scene load.