I created a script that extends Node and has a class_name of Sphere. This script then calls a function in another node called "RendererManager", which has a function called RegisterObject(obj). The idea is that the code in sphere will call this function with Self as argument, to register itself in this other class. This is done by simply adding obj to an array.
So far so good.
But then this renderermanager guy goes through all the objects in the array, and depending on what's in it does a different thing. This is where the problem lies:
for o in allObjects:
if o is Sphere:
print("it's a sphere!")
print("it's something else")
This throws an error " The identifier "Sphere" isn't declared in the current scope." I also tried "Sphere" with quotation marks, and it also does not work.
I assigned both scripts to spatial nodes. I still don't quite understand what that means yet, but it seems to be a basic node so I'm using it.