0
Fixed

Inventory - Drag item is causing Error

IndieGameHustle 3 weeks ago in Inventory updated by Marti (Lead Developer) 6 days ago 5

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!