Help? I’m trying to create basic AI to follow the player around, keep getting this ‘error’ and the Enemy Tank never moves? Here is a link to my code for the EnemyMovement Class
The console will tell you which line the error is occurring on. Whichever object you’re referencing there hasn’t been set.
Looking at your code (which you should post directly using the “101010” button) my guess is that you should change
player = GameObject.FindGameObjectWithTag ("Player").transform;
to
player = GameObject.FindWithTag("Player").transform;
And in Awake(), change
NavMeshAgent agent = GetComponent<NavMeshAgent> ();
to
agent = GetComponent<NavMeshAgent>();