Drag & Drop anything in Unity - Inventory/Spells/World Placement/Trading

Поделиться
HTML-код
  • Опубликовано: 22 май 2024
  • 00:00 Introduction
    00:25 Most Important Part Ever..
    00:34 Unity Drag & Drop Example Project - game.courses/dragdrop/
    02:40 - DragDropThing Script
    05:55 - Inventory Example - game.courses/mp/
    06:52 - UIInventorySlot
    10:10 - Multiplayer Mastery Course - game.courses/mp/

Комментарии • 19

  • @TheKarishi
    @TheKarishi 4 месяца назад +6

    This is one of those tutorials that needs a refresh every couple years as the basics remain steady but the grammar/syntax of Unity means it needs tweaking. As someone who loves playing with the idea of computerized card games - especially the stuff that would be totally unfeasible for physical card games, like "Move all Elves in your deck 1 step closer to the top" or "Each time you play this spell, increase its damage by 5" - I ALWAYS have to know the latest tricks for draggin' and droppin'.

  • @MarushiaDark316
    @MarushiaDark316 4 месяца назад +2

    I love how Jason has a Needler just casually sitting on his desk in the background.

  • @TChrisBaker
    @TChrisBaker 3 месяца назад

    This was really helpful. When I tried this in my project another key thing I learned (Copilot helped me) was having to reparent the object as it is dragging so that it can be seen outside the canvas it was currently in. then reparent it to the right canvas after the drag ends so it can be seen correctly

  • @BigDaddyGameDev
    @BigDaddyGameDev 4 месяца назад +4

    Legend, thanks Jason.

  • @ivanberezovski3665
    @ivanberezovski3665 4 месяца назад +1

    Nice tutorial

  • @dbweb.creative
    @dbweb.creative 4 месяца назад +1

    Use text instead of image for the drop area. It's a lot more performance-friendly than an empty image when thinking about batching and other stuff. Just a simple empty text component with its collider. Doesn't need any material/font etc. Especially on mobile.

  • @BadBanana
    @BadBanana 4 месяца назад +1

    An excellent explanation

  • @flamart9703
    @flamart9703 4 месяца назад

    Thank you very much, Jason!

  • @steveradtke1308
    @steveradtke1308 4 месяца назад +1

    Thank you!! This was so helpful.

  • @lukdev
    @lukdev 4 месяца назад

    LEGEND!!!! tnks for this!

  • @evanlane1690
    @evanlane1690 4 месяца назад

    Nice! Thanks!

  • @midniteoilsoftware
    @midniteoilsoftware 4 месяца назад

    "Be sure to draaaag that mouse down and click the like button or drop a comment" - lol. I see what you did there.

  • @SirFlickka
    @SirFlickka 4 месяца назад

    now to combine the items together and design new items

  • @calfry
    @calfry 4 месяца назад

    Don't know if it's just me but OnDrag() needs to be like this with my setup:
    {
    Vector3 screenPoint = Input.mousePosition;
    screenPoint.z = 100f; // distance of the plane from the camera
    transform.position = Camera.main.ScreenToWorldPoint(screenPoint);
    }

  • @koenfrontatie
    @koenfrontatie 2 месяца назад

    Hey, this doesn't work when using a canvas with Screen Space - Camera render mode. What would be a good way to adapt? Thanks!

  • @scottstephen3125
    @scottstephen3125 4 месяца назад

    Hi Jason. Is there any way of making the drag less 'laggy' if moved with speed? On an Android build it can be quite noticeable if using your finger instead of a mouse.

    • @dbweb.creative
      @dbweb.creative 4 месяца назад +1

      I think what you are encountering is the OS-default how long it take for something to be counted as a touch/drag. Maybe there is a setting in Unity for that, not sure.