Tell me how to fix the script error CS0246
I wrote the same example in the book, but I got an error in Unity. Give me a solution
public Person father;
public Person mother;
public Person son;
void Start() {
father = new Person();
father.firstname = "Greg";
father.lastname = "Lukosek";
father.age = 29;
father.isMale = true;
father.isMarried = true;
mother = new Person();
mother.firstName = "Greg";
mother.lastName = "Lukosek";
mother.age = 28;
mother.isMale = false;
mother.isMarried = true;
son = new Person();
son.firstName = "Kate";
son.lastName = "Lukosek";
son.age = 3;
son.isMale = true;
son.isMarried = false;
Debug.Log(father.firstName + " and " + mother.firstName +
" have a beautiful son " + son.firstName);
}
Assets/Scripts/LearningScript.cs(7,12): error CS0246: The type or namespace name `Person' could not be found. Are you missing an assembly reference?
Comment
Your answer
