Forum rules - please read before posting.

Drag&drop style inventory & background constraints problems

edited April 2022 in Technical Q&A

Hi,

I'm using a drag&drop inventory in a mobile game (touch screen settings). Drag&drop interactions works, but if you simply click on the inventory item - without dragging - it stays anchored to the cursor. How can I solve that?

On the other hand, I am using the background constraints so that the camera stays inside. In the editor it works correctly, but when I try it on mobile the constraints do not work

Comments

  • edited April 2022

    Welcome to the community, @isaacmarco. What are your AC and Unity versions?

    if you simply click on the inventory item - without dragging - it stays anchored to the cursor

    Are you saying that the item is still selected? If you can share screenshots of how it appears in-game, as well as your Settings and Cursor Managers, that'll help clarify the issue.

    Does this occur in builds, or in the Editor?

    I am using the background constraints so that the camera stays inside. In the editor it works correctly, but when I try it on mobile the constraints do not work

    Thanks for the report, I will attempt a recreation. What device are you testing on, and what are your Orientation options set to in Unity's Player settings?

  • Hi, im using Unity 2019.4.20f1 with AC version 1.74.3

    I think the item isn't really selected, since its interactions don't work.
    However, if I drag the item, the interactions works OK. The poblem ucurrs in editor and builds. My settings are:

    I am also attaching my scene and Unity settings for the white border issue on my backgrounds

    This is what my background looks like in the scene editor

    This is what my background looks like playing in the editor

    And finally, this is what my background looks like playing in the mobile build

    Thanks in advance!

  • I think the item isn't really selected, since its interactions don't work.

    If this is a case of the icon showing when the finger is pressed - and hiding when released (but not dragging), then the item is being selected and deselected.

    If you wish to only select an item once the player begins dragging, set a non-zero value for the "Minimum drag distance" slider inside the Settings Manager's "Inventory settings" panel.

    If the behaviour is different - i.e. it remains showing even after releasing the touch / click, let me know and share also details of your Inventory menu.

    this is what my background looks like playing in the mobile build

    It looks like this is a case of the mobile's screen being wider than that of the background sprite.

    Currently, it's necessary to ensure that the background sprite covers the full screen area in order for the constraint settings to work - which you can do by lowering the camera's Orthographic Size to zoom in.

    However, it should be possible to make it so that the camera can zoom in automatically in this situation - I'll see if this can be added as an optional feature in the next update, thanks for bringing the need for it to my attention.

  • Hi:

    the inventory item behaviour is different. It remains showing even after releasing the touch / click.

    I post configuration images of the item (the coin), the inventory menu and the inventory box:

    Going back to the problem with the backgrounds: reducing the orthographic size of the camera solves the problem.

  • edited April 2022

    When I set "Minimum drag distance" greater than 0:

    The error does not occur as long as you drop the item on a hotspot. On the contrary, if I drop the item in any other part of the background, the cursor stays with the shape of the item

  • I'm afraid I can't recreate the issue, despite using the same settings as your screenshots.

    What is your Cursor Manager's "Cursor rendering" option set to, and does the issue persist if - in the Editor - you set the Settings Manager's "Input method" to "Mouse And Keyboard"?

    In a backup/duplicate project, update to the latest AC release to see if it's still present in v1.75.2.

  • Hi, I was using Cursor Rendering="Unity UI". I have changed the setting to "Software" and the problem is solved. Anyway, I'll try to update to the new version of AC shortly. Thank you very much for the great support

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.