@davidovitch82 found and fixed the problem.
2d Roguelike tutorial error: "The type or namespace name `BoardManager' could not be found"
I'm following the tutorial step by step, but ran into this error. Existing answers didn't seem to apply to my case.
Assets/Scripts/GameManager.cs(7,16): error CS0246: The type or namespace name `BoardManager' could not be found. Are you missing a using directive or an assembly reference?
My script looks just like the one in the tutorial vid:
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour
{
public BoardManager boardScript;
private int level = 3;
void Awake ()
{
boardScript = GetComponent<BoardManager>();
InitGame ();
}
void InitGame()
{
boardScript.SetupScene(level);
}
}
I don't have much c# experience so this may be a beginner's mistake, but as I said the code looks just like the one in the tutorial as far as I can tell. Thanks in advance for any help!
Same here.. I am stuck at this point from long time.. please provide the solution or any related hints I would really appreciate it!!
Answer by getyour411 · Sep 08, 2015 at 03:11 AM
Add the class BoardManager to the current/same GameObject that GameManager is attached to.
Thanks for the reply. As it turns out the Board$$anonymous$$anager script had a typo near the top (mistakes are always so silly when you find them) ;)
What was the typo? I'm following it step by step and even copy/pasted the Board$$anonymous$$anager script from the video 4 page (https://unity3d.com/learn/tutorials/projects/2d-roguelike-tutorial/writing-board-manager?playlist=17150) and I'm still getting the error.
@getyour411 for the future, this was not a null reference exception but a missing type/namespace error when building, i.e. it couldn't find the class called Board$$anonymous$$anager. Which either had an error in it so it was not built out in the default Unity namespace or the class was erroneously named.
I just ran into this exact problem.
In troubleshooting another issue, I ended up copy/pasting the completed version of Board$$anonymous$$anager into my code. Then when I tried to run the code, this error popped up. I had to remove the namespace completed {
and the corresponding ending curly brace at the end of the file to get rid of this error.
Like wise, I commented out the namespace and hid the brackets. This removed the error although now I just have a blue screen.
//namespace Completed //{ //}