Forum rules - please read before posting.

[Bug] Drag and drop inventory items

After moving to the system where Unity UI blocks from clickthrough without the necessity for custom assigned rect transform I ran into a bug, where if I Click to drag an inventory item and release over unity UI that is a raycast blocker, the drag state sets to none, but the item still continues to drag. I narrowed down the issue to this line in PlayerInteraction.cs:

Code comment seems to be a bit vague, so I was wondering what UI issue does this code work around? Maybe that scenario is impossible in my project and I can safely remove that part?

Comments

  • I don't recall exactly, but it was a means of fixing a previous bug. I shall attempt a recreation.

  • edited February 2020

    Recreated. If the mouse click is released, and you're using drag-and-drop inventory it's best to clear the inventory regardless of UI state.

    Try replacing lines 205 with:

    if (KickStarter.playerMenus.EventSystem != null && KickStarter.playerMenus.EventSystem.IsPointerOverGameObject () && !KickStarter.settingsManager.InventoryDragDrop)
    
  • Thanks, I'll report if this has any knock-on effects.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.