Class not found

Hello everyone,

I have a basic problem but I can’t find how to fix it.
I have a class called ClassA and another called ClassB.
I use a third class to call them, let’s call it ClassC.
When I call ClassA in ClassC it works, but when I use the exact same method for ClassB it doesn’t work. After several try I think it might be because my ClassB cannot be find by Unity ?
Here is my ClassC :

ClassA classA;
ClassB classB;

void Start(){
    classA = GameObject.FindObjectOfType(typeof(ClassA)) as ClassA;
    classB = GameObject.FindObjectOfType(typeof(ClassB)) as ClassB;
}

void Update(){
    classA.functionATest();//works
    classB.functionBTest();//doesn't work
}

ClassB has the same name for the file and for the class. I don’t have any other error. When I delete the two lines in Start() it doesn’t change my error so I think it’s not coming from here, that’s why I think it simple doesn’t recognize my ClassB.
The method I am trying to get in ClassA and ClassB are simply getters, so it is the same code for ClassA and ClassB so I don’t think it’s coming from my the method as well.
Here is the error I have : Object reference not set to an instance of an object at line 11

Thanks in advance

Check if classB is still null in Start().

Sorry for late reply, thank you for your answer
Yes, I have the same message error when I put it in Start()

What is that telling you?

Object reference not set to an instance of an object
I think it’s related to the fact that because the object is created when we click on a button so the object doesn’t initially exist. But I am not sure about it

So ClassA works but ClassB does not. How are you debugging the instantiation of ClassB? How is it different than ClassA? Could it be related to script execution order? That is, does ClassB depend on ClassA in any way? Please share the code for both.