Exports within exports ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Teln0

Hi everyone !
After tons of googling and documentation reading, I still can’t figure out how to do one thing :

If I have a settings script/class that looks like this :

#settings.gd
extends Node
export var size : float
export var color : Color

And I use it in some other script (attached to a Planet node) that looks like this :

#planet.gd
const Settings= preload("res://Scripts/settings.gd")
var settings : Settings

How can I export the settings variable so I can access the size and color variables from the Planet node ?

Thanks in advance !

edit : the Planet node is just an empty node containing mesh instances and things like that

Do I understand you correctly; you want to read constants from settings.gd into planet.gd and then export these as variables from planet.gd so you can edit them through the Planet node in the editor?

aa | 2020-01-04 03:39

Yes exactly, that’s what I want to do

Teln0 | 2020-01-04 13:41

:bust_in_silhouette: Reply From: Teln0

I solved it myself ! I was adding an _init() function to my resource script and that was messing things up. I can now just export(Resource) var settings : Resource and access my data from there (I couldn’t before because of the _init() function for some reason)