- Home /
Question by
judahcline · Aug 12, 2020 at 11:45 PM ·
scripting problemscript.error messageerrormessage
CS0101:namespace '' already contains a definition for script 'AutoMoney' a message that pops up and i dont know what to do
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AutoMoney : MonoBehaviour
{
public bool CreateMoney = false;
public static int MoneyIncrease = 1;
public int InternalIncrease;
void Update()
{
InternalIncrease = MoneyIncrease;
if (CreateMoney == false)
{
CreateMoney = true;
StartCoroutine(CreateTheMoney());
}
}
IEnumerator CreateTheMoney ()
{
RisingNumber.NumCount += InternalIncrease;
yield return new WaitForSeconds(1);
CreateMoney = false;
}
}
,
Comment
Answer by Spip5 · Aug 13, 2020 at 01:19 AM
It is very likely you have two scripts in your Asset folder that contain
public class AutoMoney :
Check if you have any duplicate among your scripts, if so then remove the unused one and your problem will be solved