Drag and Drop System in Unity - Puzzle Game Example and Inventory 2021

Поділитися
Вставка
  • Опубліковано 12 січ 2025

КОМЕНТАРІ • 63

  • @berkucar8420
    @berkucar8420 2 роки тому +5

    I've watched hundreds of lectures on this topic. I'm not exaggerating, hundreds of lessons... My hours were wasted and this lesson was the solution to everything. I wish you continued success. Thank you so much.

  • @standardLit
    @standardLit Рік тому

    I never thought drag and drop system would be this simple.. you really have some amazing teaching skills man..

  • @gamedevel22
    @gamedevel22  3 роки тому +5

    Have you already seen the after credits special at the end of my videos? 😈

  • @KnowInDetails
    @KnowInDetails 3 роки тому +1

    loved the simple ,easy and quick tutorial for the drag & drop.

  • @wing-views
    @wing-views 2 роки тому +1

    A hidden gem. You deserve more subscribers brother ❤️

    • @maxhumblet311
      @maxhumblet311 8 місяців тому

      it's almost a litteral copy from another creator ua-cam.com/video/BGr-7GZJNXg/v-deo.html

  • @momozaki4453
    @momozaki4453 3 роки тому +1

    Thank you so much this is very helpful & simple

    • @gamedevel22
      @gamedevel22  3 роки тому +1

      Appreciate the support mate!

  • @MightyJor
    @MightyJor 3 роки тому +1

    That’s awesome! Drag and drop system looks great man

    • @gamedevel22
      @gamedevel22  3 роки тому

      Much appreciated mate! Glad you like it :D

  • @alvirahesc7436
    @alvirahesc7436 3 роки тому +3

    Thank you so much! As always, great video! Very simple yet detailed.
    Do you have a tutorial video on how to make a minigame inside a game? So that the player can play this puzzle minigame inside like the main 2D platformer game when player interacts with an object.

    • @gamedevel22
      @gamedevel22  3 роки тому +1

      Thank you for the kind wirds!
      If you have that mini game ready you can create a new scene for it and adjust it as you like. Then when you interact with a specific object in your main game you could just call the scene with the mini game in it!

  • @malimakes
    @malimakes 3 роки тому +1

    amazing tutorial Savvu! Thank you so much for this one!

    • @gamedevel22
      @gamedevel22  3 роки тому

      I thank you too for watching the video :D

  • @_Garm_
    @_Garm_ 3 роки тому +1

    This was a really great tutorial! :D

  • @squarewolfgames2587
    @squarewolfgames2587 3 роки тому +1

    Ik these are old sprites from another project, but i wanted to point how much i like the terraria swords feel to them (and flash vibes)

    • @gamedevel22
      @gamedevel22  3 роки тому +1

      The Sprites are here just for the demonstration and for making things beautiful :D

    • @squarewolfgames2587
      @squarewolfgames2587 3 роки тому +1

      @@gamedevel22 yes haha, need butiful things :3

  • @RiptideDev
    @RiptideDev 3 роки тому +1

    If I ever use Unity, this will come in handy!

    • @gamedevel22
      @gamedevel22  3 роки тому

      Maybe for your next project :D

  • @VuVuuInc
    @VuVuuInc 3 роки тому +1

    looks very nice, good job!

  • @fennecfugames
    @fennecfugames 3 роки тому +1

    Nice tutorial 😄 very useful

    • @gamedevel22
      @gamedevel22  3 роки тому +1

      Glad you enjoyed it! Hope it helped 😁

  • @manfung6333
    @manfung6333 3 роки тому +1

    pretty helpful!

  • @skibsted123
    @skibsted123 2 роки тому

    Can you use this kind of jigsaw pieces with drag/drop system in AR?
    i think the main problem is that in AR the physical pieces needs to be in certain position for something to trigger. but im unsure if the vuforia engine can handle it - like the drag and drop systems and the AR aspects that it is already running.

  • @edwine3764
    @edwine3764 3 роки тому

    Great tutorial, thank you! The swords now only snap into place if the mouse is above the slot. Is there a way to make the swords snap into place if the sword itself is touching the slot?

  • @michaeltan7080
    @michaeltan7080 3 роки тому +1

    Great tutorial! Is that workable in mobile platform?

    • @gamedevel22
      @gamedevel22  3 роки тому +1

      It should be working yes since all functions are also available for mobile

  • @신주영-j1s
    @신주영-j1s 2 роки тому

    Thank you for easy tutorial. But I have problem about slot script. error console log was
    "The type or namespace name 'DragAndDrop' could not be found (are you missing a using directive or an assembly reference?)"
    Could you help me about error issue?

  • @limweikee4188
    @limweikee4188 2 роки тому

    Hi, may I know how to destroy the image after the image drop into the correct slot? 😭 And go back to the initial place when the image drop into the wrong slot.

  • @Rappenem
    @Rappenem 3 роки тому +1

    Good video :)

    • @gamedevel22
      @gamedevel22  3 роки тому

      Thanks to your amazing assets bro!

  • @syarifahatika6945
    @syarifahatika6945 3 роки тому

    hi. is this tutorial can be use for mobile games?

  • @nguyenphuc2897
    @nguyenphuc2897 3 роки тому +1

    How can we make the item reset to position if we drag to blank space?

    • @gamedevel22
      @gamedevel22  3 роки тому

      The reset Position function is the same all the time. Dependig on your needs you just need to find out where to call at and in which situation.

  • @humayrabakar4207
    @humayrabakar4207 3 роки тому

    I fixed the issues but I overcame another one. when I drag object to the incorrect slot it disappears instead of going back to initial positin

  • @lora6938
    @lora6938 3 роки тому +1

    Hello
    How to make a sprite come to the front on mouse click?

    • @gamedevel22
      @gamedevel22  3 роки тому

      Heey! Do you mean like making the Sprite pop out? You could increase the localSize when you click it

    • @lora6938
      @lora6938 3 роки тому

      @@gamedevel22 I need any sprite to be in the foreground when the mouse is clicked on it
      Can you help with this?

    • @gamedevel22
      @gamedevel22  3 роки тому

      Yes create a new sorting layer named foreground and place it in front of everything else. When you click on the Sprite change in Code it's sorting layer to the one you created

    • @lora6938
      @lora6938 3 роки тому

      @@gamedevel22 Can you show how a line of code in a script should look like?🙏

    • @gamedevel22
      @gamedevel22  3 роки тому

      For things like that feel free to join the Discord Server with the link in the description

  • @yanz3e14
    @yanz3e14 3 роки тому +1

    hello...how can i add scoring system for the drag and drop..i'm not really good at coding can you do a tutorial for the scoring system?..player get a score for every correct image..thankyouu..

    • @gamedevel22
      @gamedevel22  3 роки тому

      Heey my previous video where I create a Puzzle game has exactly that feature.
      You can find it on my profile :D

    • @yanz3e14
      @yanz3e14 3 роки тому

      @@gamedevel22 hi i followed the tutorial but its not working..whenever i drag to its correctForm, the image will return to original position..

  • @waddupshairie
    @waddupshairie 2 роки тому

    Hello I have a problem where my drag doesn't work even after I export to my phone it is still doesnt work

  • @o9o7_
    @o9o7_ 2 роки тому

    How can I do this with 3d Objects?

  • @agnostixxx6083
    @agnostixxx6083 3 роки тому +1

    спасибо

  • @lightningcode1136
    @lightningcode1136 3 роки тому +1

    Do you want to do a Collab sometime (When I get more professional)

  • @StrophicValley
    @StrophicValley 3 роки тому +1

    Hype

    • @gamedevel22
      @gamedevel22  3 роки тому

      My hype is raised every single time I upload 😂

  • @pavanteja2219
    @pavanteja2219 2 роки тому

    you are doing it in screen space , the dragging is not working in world space ...

  • @andrebarcelos3114
    @andrebarcelos3114 3 роки тому +2

    I only liked because I am the 69th like.
    JK i would still have liked. Great Video!

    • @gamedevel22
      @gamedevel22  3 роки тому +1

      Thank you so much! You have chosen a great number :D

  • @humayrabakar4207
    @humayrabakar4207 3 роки тому

    Hi the drag and drop works but the clot still overlaps the piece. How do I fix this?
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.EventSystems;
    public class BonesDragAndDrop : MonoBehaviour, IPointerDownHandler, IBeginDragHandler, IEndDragHandler, IDragHandler
    {
    private RectTransform rectTrans;
    public Canvas myCanvas;
    private CanvasGroup canvasGroup;
    void Start()
    {
    rectTrans = GetComponent();
    canvasGroup = GetComponent();
    }
    public void OnBeginDrag(PointerEventData eventData)
    {
    Debug.Log("BeginDrag");
    canvasGroup.blocksRaycasts = false;
    }
    public void OnDrag(PointerEventData eventData)
    {
    Debug.Log("OnDrag");
    rectTrans.anchoredPosition += eventData.delta / myCanvas.scaleFactor;
    }
    public void OnEndDrag(PointerEventData eventData)
    {
    Debug.Log("EndDrag");
    canvasGroup.blocksRaycasts = true;
    }
    public void OnPointerDown(PointerEventData eventData)
    {
    Debug.Log("CLICK");
    }
    }

  • @ГеоргийКолесов-г9у

    Спасибо