I am making the survival game made by Unity at their 2014 convention, using Unity 4.6, and I am getting error CS0101: The namespace 'global::' already contains a definition for 'EnemyMovement'. My code is shown below
using UnityEngine;
using System.Collections;
public class EnemyMovement : MonoBehaviour;
{
Transform player;
//PlayerHealth playerHealth;
//EnemyHealth enemyHealth;
NavMeshAgent nav;
void Awake ()
{
player = GameObject.FindGameObjectWithTag ("Player").transform;
//playerHealth = player.GetComponent ();
//enemyHealth = GetComponent ();
nav = GetComponent ();
}
void Update ()
{
//if(enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)
//{
nav.SetDestination (player.position);
//}
//else
//{
// nav.enabled = false;
//}
}
}
↧