All of a sudden my scripts don't work. They have a compiled error where the script class cannot be found.
My variables are not updating properly. I removed one but it still showed in unity. All my scripts do not work all of a sudden and I have these errors which should not be there.
I am trying to make collectible coins and I have two separate scripts. One is like this, it is the coin system:
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;
public class CoinSystem : MonoBehaviour { public GameObject scoreText; public static int theScore;
void Update()
{
scoreText.GetComponent<Text>().text = "Coins: " + theScore;
}
}
and the other is like this: using System.Collections; using System.Collections.Generic; using UnityEngine;
public class CollectCoin : MonoBehaviour { public AudioSource collectSound;
void OnTriggerEnter(Collider othe
collectsound.Play();
CoinSystem .theScore += 1;
Destroy(gameObject);
}
}
I don't know what is happening but I am having the same errors and my scripts are not updating. For example, I removed variables like public AudioSource but it still shows it in unity. The scripts do not update properly and I have the same errors: can't add scripts, compiled error....script cannot be found...
PLEASE HELP
Your answer
Follow this Question
Related Questions
I want my script to wait 2 seconds before continue in a condition, in update, using C# 2 Answers
Missing the class attribute 'ExtensionOfNativeClass' 4 Answers
Updating Visual Studio from C#4 to C#7 3 Answers
Gravity for 2D game is lighter after updating unity yet all the settings are still the same. 0 Answers
void Update() problem 1 Answer