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

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ต.ค. 2024

ความคิดเห็น • 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.

  • @Luluskuy
    @Luluskuy ปีที่แล้ว

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

  • @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 5 หลายเดือนก่อน

      it's almost a litteral copy from another creator th-cam.com/video/BGr-7GZJNXg/w-d-xo.html

  • @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

  • @momozaki4453
    @momozaki4453 2 ปีที่แล้ว +1

    Thank you so much this is very helpful & simple

    • @gamedevel22
      @gamedevel22  2 ปีที่แล้ว +1

      Appreciate the support mate!

  • @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

    • @gamedevel22
      @gamedevel22  3 ปีที่แล้ว

      Hope it was helpful to you :D

  • @fennecfugames
    @fennecfugames 3 ปีที่แล้ว +1

    Nice tutorial 😄 very useful

    • @gamedevel22
      @gamedevel22  3 ปีที่แล้ว +1

      Glad you enjoyed it! Hope it helped 😁

  • @VuVuuInc
    @VuVuuInc 3 ปีที่แล้ว +1

    looks very nice, good job!

    • @gamedevel22
      @gamedevel22  3 ปีที่แล้ว

      Thank you so much bro!

  • @RiptideDev
    @RiptideDev 3 ปีที่แล้ว +1

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

    • @gamedevel22
      @gamedevel22  3 ปีที่แล้ว

      Maybe for your next project :D

  • @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

  • @edwine3764
    @edwine3764 2 ปีที่แล้ว

    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?

  • @신주영-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?

  • @gamedevel22
    @gamedevel22  3 ปีที่แล้ว +5

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

  • @manfung6333
    @manfung6333 3 ปีที่แล้ว +1

    pretty helpful!

    • @gamedevel22
      @gamedevel22  3 ปีที่แล้ว

      Really hope so! Thank you :D

  • @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.

  • @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

  • @syarifahatika6945
    @syarifahatika6945 3 ปีที่แล้ว

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

  • @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!

  • @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.

  • @eyyosyber
    @eyyosyber 2 ปีที่แล้ว

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

  • @humayrabakar4207
    @humayrabakar4207 2 ปีที่แล้ว

    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

  • @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..

  • @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

  • @o9o7_
    @o9o7_ 2 ปีที่แล้ว

    How can I do this with 3d Objects?

  • @pavanteja2219
    @pavanteja2219 2 ปีที่แล้ว

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

  • @agnostixxx6083
    @agnostixxx6083 3 ปีที่แล้ว +1

    спасибо

    • @gamedevel22
      @gamedevel22  3 ปีที่แล้ว +1

      Thank you so much!

  • @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 😂

  • @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 2 ปีที่แล้ว

    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");
    }
    }

    • @humayrabakar4207
      @humayrabakar4207 2 ปีที่แล้ว

      I also added the canvas group to piece

  • @ГеоргийКолесов-г9у
    @ГеоргийКолесов-г9у 3 ปีที่แล้ว

    Спасибо