#custom resource as export variable

11 messages · Page 1 of 1 (latest)

thorny heart
#

i have a pistol scene, that inherits from a base weapon class, that takes a custom resource (weapon attributes) as an export variable. when i run the game, upon trying to access any of the properties from the custom resource it errors out saying "Invalid access to property or key 'capacity' on a base object of type nil" capacity there being the first property it tried to access in the _ready function

thorny heart
#

well heck, for those who find this after me all i needed to do was set the deafult value of the export variable to a new object of the same type

#

i suppose it acts like aan empty container for the resource to fill once loaded

#

and without it it there is nothing to fill

thorny heart
#

wait no scratch that, im just getting the new but empty object

thorny heart
#

well, update. it seems the issue isnt the export variable

#

its how im instantiating the scene. its not loading any of the inspector properties

#

instantiating through code has nothing, but dragging it into the scene tree before run time and everything works fine

#

is there another way im supposed to do this, or something im missing?