- Edited
I'll simplify this, 2 nodes. Product and Main
Main node
var product = preload ("res://Products/Product.gd")
var productlist = []
func _ready():
create_products()
func create_products():
var product1 = product.new(null)
productlist.append(product1)
Product Node
func _init(price):
price = 10
So what I want to do is print out the price of the product. So it would just print "10". I can't seem to do this. I tried.
print(product1.price)
But apparently that doesn't work.