Item Drop API Outdated?

Bernkastel

Member
I am looking to add a dropper to an object which can spawn items directly from code. On the Item and Currency Droppers documentation page it is suggested that "If you wish to drop a specific item you can call “Drop(item)”. However when looking at Drop in code, it has no override taking an iteminfo type. Does this mean that the only way to spawn an item through code is using an itemobjectspawner now?
 
Ah sorry about that.

I'll make DropItemPickup and DropInventoryPickup functions public in the ItemDropper class for the next update.

As you mentioned you could also use ItemObjectSpawner component if you want to. That's easily accessible anywhere using the InventorySystemManager.GlobalRegister.
 
Are there any advantages/disadvantages to using dropper over item spawner? It seems item droppers can drop items with a radius but cannot delay or autodestroy, but item spawner cannot drop with a radius.

Also what exactly is autodestroy?
 
Last edited:
I updated the comment for the SpawnAutoDestroy, to make it a bit more clear:
Spawn the item object and automatically destroy it after a certain delay.

The advantage of the Item object spawner is that you can use it anywhere within the code, just like if it was a singleton (expect it's not).
The advantage of the Item Dropper is that it is a component that you can predefine what will be dropped in advance. Example set an ItemDropper on a enemy or a tree such that it drops items on destroy, this can be done very easily.

ItemObjectSpawner lets you choose a postion to drop so you can very easily find a radius using a Unit Sphere or Cirlce. something around the lines of:
Code:
var circle = Random.insideUnitCircle * m_DropRadius;
var randomPosWithinRadius = new Vector3(circle.x, 1, circle.y);
 
Top