It comes up with the Error CS0101 The namespace global already contains a definition for EnemyMovement
using UnityEngine;
using System.Collections;
public class EnemyMovement : MonoBehaviour
{
Transform player; // Reference to the player’s position.
PlayerHealth playerHealth; // Reference to the player’s health.
EnemyHealth enemyHealth; // Reference to this enemy’s health.
NavMeshAgent nav; // Reference to the nav mesh agent.
void Awake ()
{
// Set up the references.
player = GameObject.FindGameObjectWithTag (“Player”).transform;
playerHealth = player.GetComponent ();
enemyHealth = GetComponent ();
nav = GetComponent ();
}
void Update ()
{
// If the enemy and the player have health left…
if(enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)
{
// … set the destination of the nav mesh agent to the player.
nav.SetDestination (player.position);
}
// Otherwise…
else
{
// … disable the nav mesh agent.
nav.enabled = false;
}
}
}
generally the “internet usage” of “noob” is an insult… newb/newbie not so much. shrugs no idea where it started, but it’s a widely held belief from what I’ve seen.
thats how language works. thats how it always worked, two words can have the same meaning but different tones or connotation. “Mom”, “Mother” and “Mama” all mean the same thing, but they have slightly different emotional tones and connotations, which varies from culture to culture. if you’re writing a character in a story, then using the right word goes a long way in giving that character depth.
Words also evolve. “Geek” and “Nerd” are also similar in meaning but different in tone. but back twenty-thirty years ago they were more commonly considered as negative insults. today “Geek” is more commonly considered a compliment of someone who has a love in a breadth of knowledge which in many of todays industries (especially including game dev) can greatly benefit from.
Well actually, in my world noob means beginner, it was used for that when it was taught of in the first place and it will have the same meaning to me. I don’t care if people didn’t understand what it is and changed it into something else, that’s not my problem.
Even if it did insult the guy, at least he now knows that i didn’t aim to insult him, and of course if i didn’t mean it, then you shouldn’t feel insulted.
Open your project in Visual Studio/MonoDevelop, press control F, search for EnemyMovement. You have two classes with the same name. Delete one of them.
Are you using any plugins or third party code? Those could have an EnemyMovement defined as well. If that’s the case then just rename your EnemyMovement to something else.
Edit:
Or namespace your’s correctly
namespace MyNamespace
{
public class EnemyMovement : MonoBehaviour
}
In unity, in the “Project” tab, highlight all the assets, right click and find “Export Package”, a second screen will pop up. make sure everything has a check in the box. then click export. upload that package file to the forum. I’ll take a look at it.