Custom Item Drops
Learn how to create custom item drops!
Method One
If you'd like to change the look of dropped items, use the 'Override Item Drop' option in Items. This field will override the default prefab spawned when the item is dropped, and instead spawn the prefab of your choice. The downside to this is that you'd have to manually create a prefab for each of your items. But once you create one, the rest can be copied with the item model changed. Make sure to follow the Custom Prefab Rules.
Method Two
Do not change the prefab names!
Inventool automatically spawns item drops using default prefabs. You can find both the 2D and 3D prefabs in the Assets/Inventool/Resources/Inventool/ItemDrops
folder. By customizing these, you'd be customizing the default prefabs spawned for all items. Ensure you don't make a change that conflicts with the Custom Prefab Rules.
This method requires less (overall) work, but the downside is that you have to add your own logic for loading the correct item model if you don't plan on keeping the SpriteRenderer
component.
Custom Prefab Rules
There are a few rules to follow when creating custom item drop prefabs:
The object's root must have an Item Drop component attached. It simply needs to exist—you can leave the properties empty.
The object's root must have a collider set as a trigger on its root GameObject that acts as the pick up range.
The object's root should have a Rigidbody (3D or 2D) attached to it for collision purposes (mostly for detecting when the player is in range).
If your item drop model could be moved through the physics engine in any way, ensure that the trigger collider is moving along with it.
You can use the item drop prefabs in Assets/Inventool/Resources/Inventool/ItemDrops
as as example. Please note that they are just examples—if you're following the rules above, your custom prefabs should work fine.
Last updated