Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Help me with dragging an object to another object.

Discussion in 'Getting Started' started by RomanticFC, Dec 16, 2018.

  1. RomanticFC

    RomanticFC

    Joined:
    Oct 24, 2018
    Posts:
    2
    I want to create a small piece. This step can not be resumed.

    The required creation steps are: I created 5 separate objects and one button, giving object 1-4 an A-D variable, and object 5 was for inserting A-D.

    The idea is to:
    When we want to drag objects A and B into object 5 and press button when object 5 receives value that A + B is equal to load screen 1.
    And
    When we want to drag objects C and D into object 5 and press the button when object 5 gets C + D equal to screen load 2.

    This is my idea. Please tell me about C # code so I can do the work.
    Thank you very much
     
  2. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,042
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Not sure exactly what you are trying to do. But my tutorial on Drag and Drop will get you some of the way.

     
  4. BlankDeedxxAldenHilcrest

    BlankDeedxxAldenHilcrest

    Joined:
    Jul 10, 2018
    Posts:
    292
    Hah, I checked out your video and I was already a subscriber.
     
    Kiwasi likes this.