0
Under review

Adding Custom Skin to Inventory Breaks Things

Cr4shBarcode 10 months ago in Inventory updated by Marti (Lead Developer) 9 months ago 3

Okay, I've come back to working with the Inventory module after a long hiatus (it wasn't working). I disabled, then removed the module from the module manager, then re-imported it. That seems to fix everything and bring it back to square one, with the downside that it deletes everything I adjusted.

The issue now is that every time I use a custom inventory skin as opposed to one of the defaults, something stops working. I made the custom skins by duplicating one of the defaults and replacing the images with my own. Nothing crazy.

Currently, the "on drop" trigger has stopped working. With a default skin, dropping the key from the inventory onto the door makes the door open (I use the example scene to test). When I replace the skin with my own, dropping the key on the door does nothing. The inventory stays open, and none of the actions follow. I switch it back to the default skin and everything works.

I also noticed that when I create custom items to the inventory catalogue, they flat-out don't show up in the inventory. To make something show in the inventory, I have to change the name, sprite, and prefab of one of the default items. My game has dozens and dozens of inventory items to add-- what will happen when I run out of default items to customize?

Unity version:
2018.4.12f1
Game Creator version:
Under review

Without any error messages it's hard for us to know where the problem is.

Regarding items not showing in the Inventory, could you provide further details? You mean in the Inventory game UI that they don't appear? Have you tried using the "Item" action to add them? Please provide reproduction steps.

Sure, I can explain further. If I want to add an item to the inventory, I first add it in the catalogue by clicking 'Create Item'. Then I add it in the game by using an Add Item action. After this, it should be in the inventory, but it's nowhere to be seen.

I realize it's very difficult to pinpoint the problem without an error message, but I'm not sure what else to do. I just re-installed the Inventory module and I'm currently trying to use the "On Drop Item" action on a door. I added it to the inventory by repurposing one of the default items as I described above, and using the Add Item action. It does indeed appear in the UI inventory when I do this. However, when I drag it out of the inventory and onto a door with the "On Drop Item" trigger attached, it just floats in the air as a prefab--the action doesn't trigger. When I use this same item in the Inventory Example Scene and drag it onto the door, the door opens just fine. I really don't understand what's going on. I can make a video if you like?

This sounds like there's another collider blocking the view. When you drag an item from the Inventory to the scene, it casts a ray from the camera in the direction of the cursor. So, if there's something between the camera and the On Drop Item Trigger, it will simply drop the item there, because it won't reach the Trigger.

Bear in mind that there are transparent colliders, so even if you can see the Trigger, another collider might be in the way. I can't really help you, since this is very specific to your project and the demo scene seems to be working fine. If you do a video, I might be able to pinpoint the issue though