If these are classes such that the _init()
function is being used, then figure out which properties of the class must be defined outside of the class, and add them as parameters to the _init()
function:
class Foo:
var thing1
var thing2
func _init(item1, item2):
var thing1 = item1
var thing2 = item2
...
Then when it comes time to assign an object, fill in the necessary data:
var bar = Foo.new("I'm Thing 1!", "I'm Thing 2!")
Note that this is only when making a class. Regular ol' GDScript with a node that extends another node doesn't require the _init()
function to be defined. Hope that helps.