Get property error for instanced game object [SOLVED]

The Error in Question:

The engine shows that it exists in the script.
image

‘build_rooms’ isn’t called until after the level generator gets the notice from the instance that it was created…

Factory.create - > r_entrance.script : init() → controller.script
image

controller.script → r_entrance.script
image

r_entrance.script → controller.script
image

build_rooms call
image

Correct, it’s a property of your script component, not the game object.
Use a url to the script component for getting those
Properties.

Thanks,

I was just looking at the differences in the prints and noticed it was returning the hash of the game object id and not the url of it’s script. I’ll have to find a better method of storing the instances’ urls in a table rather than the id hashes.

Is there a way to make the url to the script of an instance from the id of said instance? When using msg.url() to create a url, it says that the id from factory.create() is userdata and not a string.

I think I’ve got it.

By taking the ID from factory.create() and passing that into the msg.url() as the “path” I was able to reference the script component and not just the ID hash.
image

1 Like

YEs, you can create a url like so: msg.url(nil, room, "script")

I recommend reading the manual about addressing:

1 Like