Forum rules - please read before posting.

Item Drag solution

edited June 2023 in Technical Q&A

Greetings!
A little help advise from AC community needed.

So im trying to make a simple drag n drop action in my 2D game. Click > drag > place (or item fly back).
I've read forum and tried AC's ItemArrangingPuzzle solution — and it works fine, but not that smooth as i'd like — It changes the size of items in different proportions while dragging it as inventory item cursor. And it lacks item return animation.

I guess its all easily possible with C# ... but im not on that scripting level yet. Only copy and paste)

So in case there's an easy solution — a ready made script, or tutorial, or any tested asset i should buy that integrates smoothly with AC —
let me know please! Hugs.

Comments

  • Well ok,
    my mistake — there was an option with AC's ItemArrangingPuzzle — where item itself follows the cursor drag and it not changing size.
    Works if inventory coursor change is disabled.

    There's still an issue with how to animate this item to slide back to position smoothly — so any advise be grand!

  • Welcome to the community, @whatsupworld.

    I think that's a good suggestion for the template itself - I've gone and updated the package with a new speed field in the Arranging Puzzle Manager component's Inspector, which will apply a smoothing affect when non-zero.

  • edited June 2023

    Wow its amazing! I'm so grateful for your support!
    And its its a joy to use this tool — its almost an ultimate drag template now!

    PS Оnly suggestion i could think of for future improvement sometime — is to make checkbox option to avoid first click item jump — when its center snaps to mouse position point. Kinda option for smooth grab.
    Possibly, It could be done with calculating gap between sprite pivot and click point. Then both dragging and dropping on slot goes with that difference.

  • Done - clicked items will now move smoothly to the cursor.

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.