How To Drag And Drop 3D Objects In Unity By Touch. Mobile Touch Input (Unity Tutorial for Beginners)

Поделиться
HTML-код
  • Опубликовано: 26 июн 2024
  • My wifes channel "Nirianda Art": / @niriandaart
    In this video we learn how to create C# script to drag and drop 3D GameObjects using touch input on mobile devices.
    This project on a GitHub: github.com/NikolaevAlexander/...
    Our instagram: / oceanowls.channel

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

  • @TheApm11
    @TheApm11 3 года назад +5

    Great tutorial dude. I also made this in another way, but my cube/player, was ignoring all sort of colliders. GG

    • @oceanowls-indiegamedevcrea214
      @oceanowls-indiegamedevcrea214  3 года назад +2

      Thank you! I spend a lot of time trying different ways of moving objects. And most of all like this one. That's why I decided to make this tutorial with this way of doing this.

  • @mehrnaziii
    @mehrnaziii 3 года назад +1

    this was perfect! thanks

  • @ZacharyAghaizu
    @ZacharyAghaizu 3 года назад +1

    wonderful!

  • @juanetkamm
    @juanetkamm 3 года назад +1

    Hi man, this steps may use in augmented reality.
    Would it be the same process?

  • @deusxunveiled
    @deusxunveiled 3 года назад +1

    Thank you so much , How can I drag object s z directin ? There is any way?

  • @Hemecan.
    @Hemecan. 3 года назад +3

    Hi dude, I write what you did. But in this video for cubes, there is no Rigidbody, so ı add all of them. and hit.collider.tag == draggingTag doesnt work for me. I also add all cubes a tag which is "player" So ı used hit.collider.compareTag("player") to check hit is on cubes or not. Rest is same. Thanks a lot broh :)

  • @alisonrozo8852
    @alisonrozo8852 3 года назад +1

    hello my name is alison, I have tried them with implementing it in augmented reality by chance do you know how I can prevent it from moving in the z axis?

  • @ramazukri8344
    @ramazukri8344 2 года назад +1

    Hello sir, nice video !
    By the Way, why I can't move my object to left and right ? in video you can move it to left and right, but when I try it can only move to up and down, can't move to left and right

  • @ellenyang1138
    @ellenyang1138 Год назад

    that's great! I tried it and it worked very well.
    but it only works on the x-axis and y-axis, how to make it work on the z-axis?

  • @unitedsparks719
    @unitedsparks719 3 года назад +2

    Hello, how to test it on iPhone? In Editor settings only Android devices

    • @oceanowls-indiegamedevcrea214
      @oceanowls-indiegamedevcrea214  3 года назад

      Hello.
      Try to install iTunes on your computer and tell it to trust your iPhone when you plugged in. Install Unity Remote to your phone. After this your phone should appear in your devices. Sometimes after installing iTunes you should close and open again Unity.

  • @mikethegamedev
    @mikethegamedev 4 года назад +2

    what version you uses in Unity?

  • @lora6938
    @lora6938 3 года назад

    Здравствуйте, а как придать так сказать полной физики. Что бы ведя мышь в сторону и отпустив, объекты летели по траектории и падали. Не просто вкл гравитацию в риджибоди, это не то, там объекты всегда падают как камни куда бы не перенёс.

    • @sewen_ga1s229
      @sewen_ga1s229 2 года назад

      Привет , нашел решение ?

    • @lora6938
      @lora6938 2 года назад

      @@sewen_ga1s229 Да нашла)

  • @KaganParlatan
    @KaganParlatan 2 года назад

    Music is too loud, delete music

  • @dragneeladhoo6023
    @dragneeladhoo6023 3 года назад +1

    *FAKE FAKE FAKE* 12:35 cube moved before you *dragged*
    And there is a *Cut* in the video 11:43
    What the phone pos change before remote gets activated but the phone is on a flat surface

    • @oceanowls-indiegamedevcrea214
      @oceanowls-indiegamedevcrea214  3 года назад +1

      Lol, if you don't believe that this code is working you can try it yourself. I leave a link to source code on GitHub in the description. 😂