I keep getting this error: Assets/PlayerInfo.cs(5,14): error CS0101: The namespace global::' already contains a definition for PlayerHealth’ , does anyone know the reason why this occurs?
using UnityEngine;
using System.Collections;
public class PlayerInfo : MonoBehaviour {
public GameObject Player;
int health = 100;
int damageCount = 0;
int currentHealth;
bool playerFighting;
public GUIText HealthBar;
float timer = 0.0f;
// Use this for initialization
void Start () {
currentHealth = health;
Screen.showCursor = false;
}
// Update is called once per frame
void Update () {
print (“Player in combat” + playerFighting);
}
public void ApplyDamage(int damage)
{
damageCount = damageCount;
if(damageCount == 100)
{
currentHealth = currentHealth - 10;
HealthBar.text = “Health” + currentHealth + “/ 100”;
damageCount = 0;
}
}
public void playerInCombat(int combat){
if (combat == 1) {
playerFighting = true;
} else {
playerFighting = false;
}
}
}
using UnityEngine;
using System.Collections;
public class PlayerInfo : MonoBehaviour {
public GameObject Player;
int health = 100;
int damageCount = 0;
int currentHealth;
bool playerFighting;
public GUIText HealthBar;
float timer = 0.0f;
// Use this for initialization
void Start () {
currentHealth = health;
Screen.showCursor = false;
}
// Update is called once per frame
void Update () {
print (“Player in combat” + playerFighting);
}
public void ApplyDamage(int damage)
{
damageCount = damageCount;
if(damageCount == 100)
{
currentHealth = currentHealth - 10;
HealthBar.text = “Health” + currentHealth + “/ 100”;
damageCount = 0;
}
}
public void playerInCombat(int combat){
if (combat == 1) {
playerFighting = true;
} else {
playerFighting = false;
}
}
}
using UnityEngine;
using System.Collections;
public class PlayerInfo : MonoBehaviour {
public GameObject Player;
int health = 100;
int damageCount = 0;
int currentHealth;
bool playerFighting;
public GUIText HealthBar;
float timer = 0.0f;
// Use this for initialization
void Start () {
currentHealth = health;
Screen.showCursor = false;
}
// Update is called once per frame
void Update () {
print (“Player in combat” + playerFighting);
}
public void ApplyDamage(int damage)
{
damageCount = damageCount;
if(damageCount == 100)
{
currentHealth = currentHealth - 10;
HealthBar.text = “Health” + currentHealth + “/ 100”;
damageCount = 0;
}
}
public void playerInCombat(int combat){
if (combat == 1) {
playerFighting = true;
} else {
playerFighting = false;
}
}
}