Dynamic factory versus sprite swapping

Hello again!
In my quest to get loot drops working, I’ve followed the dynamic factories example, but the factory manualalso suggests sending a message to the newly created object to switch the sprite.

I intend to have all loot behave the same way, so would it be a better setup to scrap the dynamic factory and just msg.post the sprite to change the item? What are the pros and cons of each setup?
Thanks(again)!

You can post a message to the item, but this requires the item to have a script component, and perhaps that is not necessary. You can also change the image from the point where you spawn it:

local id = factory.create("#myfactory")
local sprite_url = msg.url(nil, id, "mysprite")
sprite.play_flipbook(sprite_url, "myimage")
1 Like