NullReferenceException: Object reference not set to an instance of an object Error when i reach my enemy : <p>NullReferenceException: Object reference not set to an instance of an object Error show when im near to capsule
my code </p>

<pre><code>using System.Collections.Generic;
</code></pre>

<p>using UnityEngine;</p>

<p>using UnityEngine.AI;</p>

<p>public class EnemyControl : MonoBehaviour {</p>

<pre><code>Transform PlayerTransform; 



NavMeshAgent nma;




// Use this for initialization


void awake () {


    PlayerTransform = GameObject.FindGameObjectWithTag ("Player").transform;



    nma = GetComponent &lt;NavMeshAgent&gt;();




}




void Update () {






    nma.SetDestination (PlayerTransform.position);





}
</code></pre>

<p>}</p>

<p><a href="https://i.stack.imgur.com/WyFPl.png" rel="nofollow noreferrer">enter image description here</a></p>
