Type or namespace "ScoreBoard" could not be found

Hello there!

VS Community 2022 v17.2.6
Unity: 2021.3.6f1
Course: Complete C# Unity Game Developer 3D
Section 4: Argon Assault
Lecture: 95

Can’t go further since VS won’t allow me to use ScoreBoard:

public class EnemyCollision : MonoBehaviour
{
[SerializeField] GameObject deathVFX;
[SerializeField] Transform parent;
[SerializeField] int scorePerHit = 15;

ScoreBoard scoreBoard;

void Start()
{
scoreBoard = FindObjectOfType();
}

Any suggestions?

Hi,

Welcome to our community! :slight_smile:

First of all, check if there is a ScoreBoard script with a ScoreBoard class in it. The names must be spelt exactly the same.

If the issue persists, go to Edit > Preferences > External Tools and click on “Regenerate project files”. That often fixes certain issues with either VS or VS Code.


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms