Smooth Drag N Drop: Godot Guide

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

ความคิดเห็น • 172

  • @june_rain_video_game_company
    @june_rain_video_game_company 4 ปีที่แล้ว +35

    Dude. You are a genius. Don't ever stop making godot videos. The godot community needs people like you.

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +4

      You're too kind :') I've been really loving making these videos

    • @Zelienter
      @Zelienter 3 หลายเดือนก่อน

      @@BramwellWilliams hes just honest

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

    I have to watch this at 0.5x speed, but you are very thorough regardless! Thanks!

  • @janthoma7262
    @janthoma7262 4 ปีที่แล้ว +24

    This is easily one of the best tutorial videos I have ever seen (not just for Godot). It is so clear, to the point and easy to comprehend. Not a single second is wasted. Love it!

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

    Was breaking my head trying to remember the "lerp_angle()" func. Couldn't find it no matter what I searched. Finally remembered I heard it in this vid. Thanks. Very helpful!

  • @nguyenyenchi4201
    @nguyenyenchi4201 5 หลายเดือนก่อน +1

    Thank you so much for the tutorial! As a beginner developer, I have minimal resources with godot tutorials, but your channel has been a life savior! :3

  • @erdemozverenn
    @erdemozverenn 4 ปีที่แล้ว +6

    This is the best drag n drop tutorial and even with this lerp and zone functionality we can make a smooth looking chest and inventory systems too! Thank you for sharing!

  • @PondaYT
    @PondaYT 2 ปีที่แล้ว +4

    Incase anyone ran into the problem I was having where godot is throwing an error about "Invalid operands Vector2 and Int

  • @galo4788
    @galo4788 4 ปีที่แล้ว +8

    genius ideas tbh, i see a lot of potential on them

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

    This is so much better than the 5-script-monstrocity of a drag and drop system I'd made in unity. Much thanks.

  • @templaraiur5767
    @templaraiur5767 4 ปีที่แล้ว +4

    I just googled "godot drag and drop" and find this video and it is very useful,. Thanks for sharing!

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Thanks! really good to hear my search engine optimization isn't awful :')

  • @samownsyou123
    @samownsyou123 4 ปีที่แล้ว +28

    This video woke my father up from his coma, great job man!

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

    I usually watch tutorial videos on x1.75 to avoid details I don't need, but that was not the case here. Great stuff!

  • @katdointhat
    @katdointhat 2 ปีที่แล้ว +3

    Incredible tutorial and exactly what I was looking for. Thank you so much for filming this.

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

    Love this guide! A couple small things I did differently when I implemented it:
    In _input() for deselecting the drag-and-drop object, the same "click" event can be reused by checking if it was just released:
    if Input.is_action_just_released("click"): selected = false
    And for the distance calculation, one tip I've seen a lot to save a square root operation is to just compare the squared distance, since the comparison x < y implies x^2 < y^2. There are cases not to do this, if you eventually need exact distance for example or if the distances are so large that the squares could overflow the bounds of their unit. Of course this is just a tiny perf improvement, and if you spent years you could shave more and more microseconds off of every computation, but it's a small habit I'm using to write more optimal code.

    • @ximipa1-32-noumisyifanabil3
      @ximipa1-32-noumisyifanabil3 2 ปีที่แล้ว

      hey there, sorry to bother you but can you help me a bit? so i ran into an error that says "invalid get index "0" on base array" in 5:01 line 9, by any chance if you know what to do about it can you reply to this, it'll be a hugeee help for me, also thank you btw

  • @kalidelossantos3735
    @kalidelossantos3735 6 หลายเดือนก่อน

    great, simple tutorial. had to adapt very minor things to godot 4 but the whole tutorial works really well. thanks!

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

    Whoa, nice and straight to the point. a legend

  • @Jasonsumm
    @Jasonsumm 4 ปีที่แล้ว +9

    I was literally looking for something like this today! Thanks!

  • @vatan2578
    @vatan2578 4 ปีที่แล้ว +2

    You are a good person. I wish you and your loved ones health and happiness.

  • @kasparsfolkmanis
    @kasparsfolkmanis 3 ปีที่แล้ว +2

    Very clear and useful, thank you.
    Just want to say that this will not work if a Node2D is a child of a Control node.
    In that case you can use buttons and use the button_down and button_up signals to pick and release the button itself.

  • @alexzeitler9416
    @alexzeitler9416 4 ปีที่แล้ว +1

    Thanks for the tutorial man. Very well-thought-out and easy to follow. I really like how you walk through each bit of code and talk about what each part does logically. I've watched a ton of Godot tutorials as a beginner and yours have been the best I've seen. Keep it up, I know the community will be grateful for everything you put out!!

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Thankyou so much Alex! I'm super stoked my approach is helpful - l will c:

  • @johnnyGwaping
    @johnnyGwaping 4 ปีที่แล้ว

    I was researching on where should I start my game dev journey, because of this vid I am convinced I should use GodotEngine. With few lines of codes you achieved a lot.
    Thanks for the tutorial mate.

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      thanks - I'm really glad to hear it and great choice! being able to use python like scripts makes lots of difficult problems a breeze and the public support for tutorials has been really great the last couple years c:

  • @sujoysinha
    @sujoysinha 2 หลายเดือนก่อน

    Man I was looking for this method. Thank you. 🎉😮

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

    Hear hear, you are a great Godot Guide. First video of yours I've stumbled across, subscribed, and informed. Thank you so much!

  • @capuchinosofia4771
    @capuchinosofia4771 7 หลายเดือนก่อน +1

    This is so cool! I'm totally subscribing :D
    Any idea how to make it so the object is grabbed from the point where the user clicks it, BUT without snapping to the center of the object? Because if the user is still dragging the object but slowly/or is still, the object shakes/does a barrel roll when the object´s center reaches the mouse pointer.

  • @cyzaine
    @cyzaine 4 ปีที่แล้ว

    This was amazingly useful, well paced and well explained for an intermediate Godot user. Much thanks!

  • @joshuasamuels2143
    @joshuasamuels2143 4 ปีที่แล้ว +1

    This is the best tutorial video I've ever watched! Good on dude!

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Thankyou Joshua that's incredibly kind c:

  • @darycsan2082
    @darycsan2082 4 ปีที่แล้ว +2

    this is the tutorial that i ever want

  • @CarbsCode
    @CarbsCode 4 ปีที่แล้ว +2

    Another great job Bram! This is super neat and could come in handy for a bunch of applications! :D

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว

      Thanks Carbs! I'm really happy with this one c:

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

    Friend, this is a banger.

  • @Crisisdarkness
    @Crisisdarkness 4 ปีที่แล้ว

    Estimated Bramwell, I hope you come back, to continue making more content, I have missed you

  • @curlyboyoli6004
    @curlyboyoli6004 8 หลายเดือนก่อน +1

    I know this is an old tutorial, but did anyone find a way to ensure that multiple draggable items do not all become merged together when stacked on top of eachother? Essentially, a means of prioritizing the item on top?

  • @ansel569
    @ansel569 2 ปีที่แล้ว +3

    Great tutorial- makes a lot of sense. My question is how can I impliment a system where items can only be dragged into un-occupied slots? I'm having trouble implementing this.

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

      Did you ever find a solution to this?

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

    thanks, your tutorial and explanation is easy to understand.currently i using defold engine than godot because it's have easy ui. looks like i can apply your tutorial in defold engine to.

  • @ViniCavin
    @ViniCavin 4 ปีที่แล้ว +1

    Awesome guide, Bramwell! Thank you for that :)

  • @really_damon
    @really_damon 9 หลายเดือนก่อน

    Great tutorial! How would I adjust the code so the sprite only stays in the selected area after a player drags it within the shortest distance? Right now the sprite snaps to the closest area on game load.

  • @markpaterson2260
    @markpaterson2260 4 ปีที่แล้ว +1

    This is the first video of yours that I've found... it's gonna be mega helpful for me and my project, thank you so much.... but I'm gonna be sad when I watch other videos and don't see blanchealmond :(

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว

      Thanks! Haha, everyone needs more Blanchealmond Mark :')

  • @xAshesxElitex
    @xAshesxElitex 4 ปีที่แล้ว

    Just a comment for feedback:
    You are very clear and well-spoken when explaining what to do, but for me as a noob, I was quickly zoned out and overwhelmed by the flow of information (not that noobs are necessarily your target audience.) Great video! Just a lil over my head :P

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Really appreciated feedback! That is something I worry about, I certainly do move quickly within my videos and I think the main merit of my videos are the small tips that fill out existing knowledge - do you think written supplements that are a lot more fleshed out like blog posts would be helpful? Or slowing down the pace of the videos?

    • @xAshesxElitex
      @xAshesxElitex 4 ปีที่แล้ว

      @@BramwellWilliams I'm more attuned to learning by watching/doing, not at by reading therefore I couldn't really speak to that. I understand that those with a good base will really get value from your videos! As much as it was over my head I could really appreciate the clarity of the information. It's just that from a noob perspective the vast majority of it was new information, whereas an intermediate viewer would already have much of that knowledge. I think this video and your style has no need for adjustment, but only if perhaps you wish to make videos for newer learners then I'd advise a slower output of information per second :-P
      Hope this helps.

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      That's greatly appreciated and I will certainly bear that in mind, thankyou :)

  • @RyanScottForReal
    @RyanScottForReal 4 ปีที่แล้ว

    Hey great tutorial and thanks for the look at the internal code. Your stuff keeps getting better.

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว

      Thanks Ryan, hoping to do more behind the scenes stuff that was very illuminating for me c:

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

    Nice video man, but when I try to instance multiple draggables into a scene they all clump together, and Im not being able to fix it. Can someone help me?

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

    to the _on_Area2d_inout_event function, I added print("Clicked"), and the output window outputs "Clicked" twice, indicating that this is processing twice despite is_action_just_pressed being used. The print call is not used anywhere else in the project. Why is this executing twice?

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

    Thank you man! This was a very helpful tutorial! I had to do a bit of finagling to make it work for my game, but it's all thanks to you!

  • @FirstNameLastName-xl6hj
    @FirstNameLastName-xl6hj 2 ปีที่แล้ว +2

    What if you have multiple items in a list that can be dragged into multiple possible slots, how do we arrange the nodes? say when dragging items from an inventory to equipment slots

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

      what I done is just create seperate input events, and seperate selected variables, distance variables and if distance2 < shortest_dist...I'm sure there is more of an easier way to do this but that worked for me. One thing though is that it loses its placement to go back to the node so it's just draggable and doesn't go back to either node

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

    Have you an idea how to do it if you have multiple things that you want to drag around and check if the correct one is on top of the correct circle in that example, because im stuck with it.

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

    Hi! Thank you so much for the vid this helped a lot! However, how do i revert an area2d to its original position once i released my left click button or it entered the wrong area2d? Just like in your tools project.

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

    Wow! Great tutorial!

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

    Simple and effective solution, thanks :)

  • @Lui-po8jh
    @Lui-po8jh 10 หลายเดือนก่อน

    thanks, exactly what i needed

  • @khushraswant2852
    @khushraswant2852 2 หลายเดือนก่อน

    I have one doubt, in the earlier part of the video you are using is_action_just_pressed() and you are using _input(event) for detecting when the user stops clicking (to drag it). Cant we use is_action_pressed() which wont need _input(event) as this function only return true when holding the desired key?

  • @ximipa1-32-noumisyifanabil3
    @ximipa1-32-noumisyifanabil3 2 ปีที่แล้ว +1

    Hey there! Tysm for your tutorial it really helps a lot! but somehow when i try to use the code, i run into an error in 5:01 line 9, the error says "invalid get index "0" on base: array" im super confused on how to solve this. anyone know how to fix it?

  • @jesustzinon
    @jesustzinon 4 ปีที่แล้ว +1

    Just find your channel , cool video, i was looking something like this to make a puzzle game i will subscribe!

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว

      Thankyou! I'm really glad I could help c:

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

    I got this error in line 9 (dragndrop) invalid get index '0'(on base: Array).

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

    beautiful tutorial, very useful

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

    Why not use a second Area2d to represent the drop zones, and then handle input on collision? I dissected your code forwards and backwards and learned a lot, thanks.

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

    So I followed along in a brand new project, and in my own project. In each case I made a new scene following this tutorial, but in my existing project the functions from the Area2D signals never get called. So both scenes are exactly the same, the only difference, is that one is in my existing project. What could be wrong with my existing project?
    In fact, even if I copy the working scene files to my existing project it only works in my new project and not my existing one.
    I can't get CollisionObject2D signal to work at all in my existing project

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

    How would you get object to snap to tile map grid? Say I have a deck of tiles and I want to place them anywhere on the map, but they must snap to the nearest grid point. Basically how it works in the editor when designing levels, but be able to do it in-game. Thanks!

  • @syedrizvi6408
    @syedrizvi6408 4 ปีที่แล้ว +1

    Fantastic tutorial. You have covered some flaws, which I experienced earlier with different approach.
    Do you have a tutorial on random number generator?
    Thanks for help

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      thanks! I don't but random number generation is fairly straightforward, from any script after you've used the randomize() function I just use randi() % range and you will get a pseudo random int between 0 and the number you modulus -1. you can also use noise which I did lightly cover in my juicy screenshake video :)

  • @mesolagic
    @mesolagic 4 ปีที่แล้ว +1

    Thanks man this tutorial was really well done! Also, very interesting game concept you have there. Is the console cleaner game something you plan to release as a browser game or on steam? Cheers!

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว

      Thankyou! In my head I see the game as a desktop and mobile release although making it playable in browser is a great idea c:

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

    Thank you for sharing this

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

    Hey, so I've been working on my game and really needed this. I tried the code for drag n drop and while it did work, first my sprite went far to east south. I had this problem with the code I made aswell

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

      Did you find a solution?

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

    Very reasonable tutorial

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

    How to have multiple draggables? lets say i want to put 10 individual sprites? :(

  • @lionleobow
    @lionleobow หลายเดือนก่อน

    I know this is an old video, being new to godot this just let me rewrite 3 functions and 40 lines of code that broke my game into simply adding a lerp to my result of the movement function, then from there I was able to make a custom lerp function to simulate weight, friction and strength of the object with export variables!

  • @canaldosoninho
    @canaldosoninho 4 ปีที่แล้ว +1

    I really want to play this game

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Thanks! It's being a really fun project so I would expect something playable and more videos in the not too distant future c:

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

    Thank you so much for this...

  • @muerteplay3
    @muerteplay3 10 หลายเดือนก่อน

    yep , this is the way

  • @bananacomputer9351
    @bananacomputer9351 4 ปีที่แล้ว +1

    Awesome!

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

    Thanks for this great tutorial, it really helped me to get started in Godot :) Currently if I click fast enough I can pick up multiple draggable object at once. Is there an easy way to prevent this with the current script?

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

    Great tutorial! I have a question, why didn't you use 'if event.is_action_released("click"):' at 2:51?

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

      naivety! very good shout I'll bear that in mind going forwards thankyou :')

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

    Where is the console repair game? Looks fun!

  • @_Garm_
    @_Garm_ 4 ปีที่แล้ว

    Great tutorial, thank you! :D

  • @sailorjune2121
    @sailorjune2121 4 หลายเดือนก่อน

    i know this is an old video but i'm trying to follow along,
    at 2:30, my code is identical but when i click on the icon, it jumps away from my mouse rather than picking it up directly, anyone have any advice?

    • @Scribbzz
      @Scribbzz 3 หลายเดือนก่อน

      I'm no expert, but I played around with the values and instead of 25 I put in 60 : global_position = lerp(global_position, get_global_mouse_position(), 60 * delta)
      Hope this helps!

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

    This error appears in version 3.5
    Invalid call. Nonexistent function 'select' in base 'Position2D (zone.gd)'.
    The solution, which took me 1 hours, was as simple as usual
    rest_nodes[0].select()👎
    rest_nodes[0]._select()👍

  • @safinmahmud5091
    @safinmahmud5091 4 ปีที่แล้ว

    Very Cool!!!
    I,m curious that how to create code for dropping object(Building/Unit) from GUI to isometric or Tilemap place

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว

      Thanks! This is a cool problem I've tackled a while ago, but that was using a shader to draw a translucent version of the object I was placing and having the image snap to the closest valid building position on the tilemap to the mouse. I do believe gingeragous' tutorials may be of great help th-cam.com/video/Z0iNo9Q-cuU/w-d-xo.html
      Dragging from GUI to in game is a fiddly process I'm still trying to find the best approach for myself, if I ever do figure out a best approach I'll let you know :')

  • @IsabellsHelpfulLessons-m1y
    @IsabellsHelpfulLessons-m1y หลายเดือนก่อน

    At 2:53 into the video, I received an error message. BUTTON_LEFT needs to be MOUSE_BUTTON_LEFT in the current version of Godot.

  • @the_first_hunter
    @the_first_hunter 4 ปีที่แล้ว

    Hey I upvoted your work on reddit!
    Good job man

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Cheers! the Reddit karma fuels me xD

    • @the_first_hunter
      @the_first_hunter 4 ปีที่แล้ว

      :# good luck man

    • @the_first_hunter
      @the_first_hunter 4 ปีที่แล้ว

      Wait a minute
      I took a look into your channel,
      Dude all of your shader tutorials are in my reddit saved posts xD

  • @stathisk2949
    @stathisk2949 7 หลายเดือนก่อน

    if anyone is still here, i have a question to ask. I realized that the drag works perfectly when the sprite is centered, but if i place it away from the scene center and test the scene, the moment i click the sprite, it jumps way ahead of the mouse relative to how far away it was from the center. is there a way to fix this? thanks

    • @TableTopNeverStop
      @TableTopNeverStop 6 หลายเดือนก่อน

      what is probably happened is you moved the sprite 2d's location to a different spot than the root node. this creates an offset, you accidentally offset the sprite from the root, but you can only see it when you go to move it.

  • @5minutemovies977
    @5minutemovies977 4 ปีที่แล้ว

    I hate how you make useful videos full of tips and tricks. This makes me feel bad for not making anything slightly significant with Godot x)

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Don't put yourself down! It took me years to work most of this stuff out - I think a huge part of game development is working on little projects, the skills you learn from those are integral to becoming proficient c:

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

    Great Job!

  • @darkhunter777
    @darkhunter777 4 หลายเดือนก่อน +1

    After signal need write -- >> if event is InputEventMouseButton and event.pressed: OR write ERROR in GD4 !

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

    Did you end up releasing this electrician game? Last week Electrician Simulator was launched on Steam and it seems to be selling quite well - it's very similar (or identical, but in 3D) as to what you were doing here!

  • @abdulkadirwaziri2698
    @abdulkadirwaziri2698 11 หลายเดือนก่อน

    Please help, i am having trouble here.
    func _ready():
    rest_nodes = get_tree().get_nodes_in_group("zone")
    rest_point = rest_nodes[0].global_position
    rest_nodes[0].select()
    My function draw is not displaying the circles.
    func _draw():
    draw_circle(Vector2.ZERO, 150, Color.blanchedalmond)

    • @PrimerFPS
      @PrimerFPS 9 หลายเดือนก่อน

      it's not displaying the current scene u are working at probably, that was what happened to me lol, press f6 to play your current scene u are working at

  • @cmds.learning7426
    @cmds.learning7426 4 ปีที่แล้ว

    great job

  • @borjadetorres7747
    @borjadetorres7747 4 ปีที่แล้ว +1

    Great tut! But godot is giving a me this error "invalid set index '0' (on base 'array')". Any idea why? I have checked the code and everything seems identical.

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Hey! That sounds like when it tries to get the first item in the list of rest zones there's nothing there. Sounds quite possible there was a typo in the group name that got added at 3:54 ? Alternatively it would fail to find the rest zones if you haven't added them to a scene along with the dropable object. Hope this helps :)

    • @borjadetorres7747
      @borjadetorres7747 4 ปีที่แล้ว

      @@BramwellWilliams I've checked and theres no typo. I don't understand. If it's not much to ask, can I send you the file?

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Sure, you could link to a gist here and I'll have a peruse
      Also I have a link to my GitHub in the description if you wanted to download and fiddle with a working version of the project

    • @borjadetorres7747
      @borjadetorres7747 4 ปีที่แล้ว

      @@BramwellWilliams I've uploaded into gofile gofile.io/d/c5rNGm EDIT: Thanks a lot by the way

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      @@borjadetorres7747 no worries and I got it working! So the error you described was from running the drag drop scene which crashes as there are no rest zones it can see which makes sense, you can run the test scene using f6 when it's active or updating your project settings to have test be the main scene
      If you run your test scene it will complain it can't find the select and deselect methods because of the underscores, removing those underscores or adding underscores to all the select and deselect calls will make the test scene work c:

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

    Dude, thanks.

  • @boomerboyzr9612
    @boomerboyzr9612 4 ปีที่แล้ว

    this is great, but is there any way that if I fling a selectable object, it will go in the direction I flung it in?

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว

      thanks! For something like that you'd probably either want to use collision shapes and use move_and_slide to move the object rather than lerp, or have a seperate velocity variable and save the current direction of travel as you move the shape, then when let go move using the velocity variable if there is any and decrement it over time. Hope this is helpful!

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

    Great video!, I've learned a Lot
    But i want to make a game like drag and match...
    Thinking on kids that have to drag the correct shape into a Shadow figure.
    Previously i made this kind of game in phaser.js but i want to make it in godot can you show me how to achieve this?
    Thanks!

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

    Help how do I move more than one sprite with that code? :(

  • @eruaiokoyomoh3177
    @eruaiokoyomoh3177 4 ปีที่แล้ว +1

    Please make a 2D shockwave shader effect, that works with different viewports, or please make a video on the backbuffercopy node please

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว

      I can highly recommend this video about shockwave shaders: th-cam.com/video/SCHdglr35pk/w-d-xo.html
      consider backbuffercopies in my backlog c:

    • @eruaiokoyomoh3177
      @eruaiokoyomoh3177 4 ปีที่แล้ว +1

      @@BramwellWilliams I just came back from that video but my game uses a different aspect ratio from my screen so It doesn't work.

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      Ahh I see, fiddley. In the circle wipe part of this video It should help explain making shader affects use your window dimensions :) th-cam.com/video/sZlX9o9uF7o/w-d-xo.html

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

    thank you

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

    Thank you for a thorough and straightforward tutorial! Too awesome not to subscribe :D

  • @kito9690
    @kito9690 4 ปีที่แล้ว

    how do I stop the object from going through collision areas?

    • @BramwellWilliams
      @BramwellWilliams  4 ปีที่แล้ว +1

      That would require a fairly different approach - you would want to make the dragable object be a rigid body or kinematic body with a collision shape, and instead of moving it with lerp you would need to use move and slide and do some vector maths to come up with a vector that points to your mouse position.
      I hope that's helpful :)

  • @Icessien
    @Icessien 4 ปีที่แล้ว

    Please make an inventory system tutorial

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

    Thanks. A nice tutorial. Would have been better if there was no zoom ins though--it's a bit distracting and it forces a lot of pauses and backtracking.

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

    Does anyone know how to create drag and drop such that when dragging, png image instantly follows the position of cursor and doesn't take time to reach mouse position and doesn't falls back from cursor (also doesn't creates gaps between cursor and dragged object) ?

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

      So basically how to create dragging more fast and responsive

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

      @@peoplearecool8766 In case you're still looking for an answer: Just increase the number delta is multiplied with inside the lerp. Try 100 instead of 25

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

      @@sebcon952 THX

  • @angeloliver2825
    @angeloliver2825 29 วันที่ผ่านมา

    Position2D was name to Market2D in GD 4.x

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

    There's two type of tutorials.
    _unhandled_input or _inputEvent

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

    How to apply the tutorial for 3D meshes?

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

    Thanks

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

    I did the exact same thing until at 4:29 my work mess up

  • @7ymke
    @7ymke 3 หลายเดือนก่อน

    Position2D was renamed to Marker2D