0
Fixed

Inventory - Drag item is causing Error

IndieGameHustle 12 months ago in Inventory updated by Syed Suhaib Zubair 6 months ago 7

Hello, 

I recently purchased the Inventory Module. I am getting the below error when I attempt to drag item. 


It was at one point working then all of a sudden stopped working. I am not sure what may be causing this. 

Unity version:
2019.2
Game Creator version:
1.0.4

Answer

Answer
Fixed

I've added null checks so that the floating item property is completely optional now. If your custom inventory does't use the drag and drop feature, you won't be receiving any null reference exceptions now. I'm marking this issue as fixed and a ew Inventory version with this patch should be available very soon.

If there are any further issues related to this, feel free to reopen the ticket. Cheers!

Under review

We're opening a ticket and have a thorough look at it. To help us narrow down the problem, would you mind answering some questions?

Does this error appear again after closing and clicking Play again? So is it a one-time thing or is it happening always now?

Does any error appear in Editor when opening the Preferences Window?


Also, did you create a custom Inventory UI?


Thanks!

Hello, 

So regarding this error. It seems to have kinda corrected by adding a floating item. But it has created other issues. Please see video.

I indeed have created ( started to Create ) a custom UI.

It is expected that creating a custom Inventory UI and not having a floating element will throw errors. The Inventory Manager component expects a reference to the image that appears when the user drags an item around.

As for the offset that appears between the mouse and the floating element, it looks like it could be because of the anchor points of the Floating Element.

Check out the example Inventory skins that come with the Inventory module. In particular, check out the Floating Item object. You should have the same exact RectTransform component properties.

Ok thanks! I am looking into this now. 

Answer
Fixed

I've added null checks so that the floating item property is completely optional now. If your custom inventory does't use the drag and drop feature, you won't be receiving any null reference exceptions now. I'm marking this issue as fixed and a ew Inventory version with this patch should be available very soon.

If there are any further issues related to this, feel free to reopen the ticket. Cheers!

I have suddenly getting an issue while drag item out of inventory ui. Few days ago its working but dont know why suddenly its giving error on dragging a gun prefab out of inventory ui. its giving error of drop item. can you elaborate and resolve the issue?

Check your Inventory and the Trigger with the On Drop Item. Looks like the Trigger's Item field is empty or referencing a deleted item.