Hello, dear Defold community! I have a problem, again
I have ten different GO (call them “items”) with one item.script. Also, I have factories that spawn these GO.
Every “item” has a unique sprite and label but the same script.
I need to compare spawned “items” with the "reference"
I tried to do it by id, I wrote some code into the item.script
function init(self)
item_id = go.get_id()
print(item_id .. ' spawned')
end
but every item that spawned from the factory has id like “[/instance9]” where “9” just a serial number.
I the factory spawns one item every 5 sec it will be “[/instance0]” every time
Can you help me and explain how I can make the setup that I want?