I don’t understand why this happens at all, but the prototype doesn’t change and no error is thrown.
for i,el in pairs(self.furnitures[self.currentHouse]) do
factory.unload("#furnitureSpawner")
factory.set_prototype("#furnitureSpawner", el.game_obj)
pprint(el.game_obj, i) -- /main/gameobjects/furniture/bedroom/someobj.goc , 'i' variable
print(go.get("#furnitureSpawner","prototype")) --Always same
local furniture = factory.create("#furnitureSpawner",el.position)
table.insert(self.current_house_furniture, furniture)
end
I also noticed that the prototype is from the game_obj variable of the last element from self.furniture[self.currentHouse]