So I have a few questions about factory.create()
First off, I have an error that I’m trying to resolve
I’m not sure if the syntax is just wrong or if my setup is somehow wrong. The idea is that I have my gui script that contains the logic for what happens when you click on a button. What I want to do right now is spawn an image (currently attached to a game object) when a button is pressed. Clearly, my code is not doing that (hence the error) and I’m wondering where I’m going wrong.
Secondly, can factory objects be saves and stored in a table? What i want to ultimately accomplish (once I figure out how to use factory.create) is store all the game objects I’ve created through the factory in a table and later delete them. Is it possible to do something like:
created_object = factory.create(url, [pos])
table.insert(name_of_table, created_object)
And would removing that object with table.remove() delete the object entirely?