Тёмный

Smooth Drag N Drop: Godot Guide 

Bramwell
Подписаться 17 тыс.
Просмотров 44 тыс.
50% 1

Timestamps
Dragging: 0:22
Dropping: 2:30
Rest zones: 3:06
Hooking it up: 4:35
Rotation: 6:42
Examples 8:02
Cpp bonus: 8:35
A simple and elegant approach for dragging and dropping sprites in Godot using a variety of built in functions.
All the code is availiable on my Github here: github.com/bramreth/godot_tut...
Social links:
Twitter: / bramreth
Instagram: / bramreth
My games: bramreth.itch.io/

Опубликовано:

 

4 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 162   
@nguyenyenchi4201
@nguyenyenchi4201 9 дней назад
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
@june_rain_video_game_company
@june_rain_video_game_company 4 года назад
Dude. You are a genius. Don't ever stop making godot videos. The godot community needs people like you.
@BramwellWilliams
@BramwellWilliams 4 года назад
You're too kind :') I've been really loving making these videos
@janthoma7262
@janthoma7262 3 года назад
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!
@samownsyou123
@samownsyou123 4 года назад
This video woke my father up from his coma, great job man!
@katdointhat
@katdointhat Год назад
Incredible tutorial and exactly what I was looking for. Thank you so much for filming this.
@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!
@alexzeitler9416
@alexzeitler9416 3 года назад
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 3 года назад
Thankyou so much Alex! I'm super stoked my approach is helpful - l will c:
@cyzaine
@cyzaine 3 года назад
This was amazingly useful, well paced and well explained for an intermediate Godot user. Much thanks!
@erdemozverenn
@erdemozverenn 3 года назад
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!
@BramwellWilliams
@BramwellWilliams 3 года назад
super stoked to hear it thanks!
@kalidelossantos3735
@kalidelossantos3735 Месяц назад
great, simple tutorial. had to adapt very minor things to godot 4 but the whole tutorial works really well. thanks!
@CarbsCode
@CarbsCode 4 года назад
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:
@tiagogamer2540
@tiagogamer2540 9 месяцев назад
This is so much better than the 5-script-monstrocity of a drag and drop system I'd made in unity. Much thanks.
@Jasonsumm
@Jasonsumm 4 года назад
I was literally looking for something like this today! Thanks!
@BramwellWilliams
@BramwellWilliams 4 года назад
Happy to be of service c:
@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!
@joshuasamuels2143
@joshuasamuels2143 4 года назад
This is the best tutorial video I've ever watched! Good on dude!
@BramwellWilliams
@BramwellWilliams 4 года назад
Thankyou Joshua that's incredibly kind c:
@MichaelZesty
@MichaelZesty Год назад
Whoa, nice and straight to the point. a legend
@BenjaminWheeler0510
@BenjaminWheeler0510 8 месяцев назад
I have to watch this at 0.5x speed, but you are very thorough regardless! Thanks!
@PondaYT
@PondaYT 2 года назад
Incase anyone ran into the problem I was having where godot is throwing an error about "Invalid operands Vector2 and Int
@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:
@Serebriakov9
@Serebriakov9 2 года назад
Wow! Great tutorial!
@itmeurdad
@itmeurdad 2 года назад
Friend, this is a banger.
@ViniCavin
@ViniCavin 4 года назад
Awesome guide, Bramwell! Thank you for that :)
@BramwellWilliams
@BramwellWilliams 4 года назад
Thankyou so much! Happy to provide c:
@aqwszx2
@aqwszx2 2 года назад
beautiful tutorial, very useful
@tara5on5
@tara5on5 3 года назад
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 3 года назад
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:
@galo4788
@galo4788 4 года назад
genius ideas tbh, i see a lot of potential on them
@BramwellWilliams
@BramwellWilliams 4 года назад
Thankyou Galo! You're very kind c:
@AidenOcelot
@AidenOcelot 2 года назад
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!
@BramwellWilliams
@BramwellWilliams 2 года назад
Really glad I could help! c:
@vatan2578
@vatan2578 4 года назад
You are a good person. I wish you and your loved ones health and happiness.
@kunai9809
@kunai9809 9 месяцев назад
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!
@dantheman52420
@dantheman52420 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
@templaraiur5767
@templaraiur5767 4 года назад
I just googled "godot drag and drop" and find this video and it is very useful,. Thanks for sharing!
@BramwellWilliams
@BramwellWilliams 3 года назад
Thanks! really good to hear my search engine optimization isn't awful :')
@darycsan2082
@darycsan2082 4 года назад
this is the tutorial that i ever want
@BramwellWilliams
@BramwellWilliams 3 года назад
I'm glad to hear it c:
@juanloutech2864
@juanloutech2864 3 года назад
Thanks! This was VERY helpful!
@mopifish4912
@mopifish4912 2 года назад
Simple and effective solution, thanks :)
@_Garm_
@_Garm_ 4 года назад
Great tutorial, thank you! :D
@Lui-po8jh
@Lui-po8jh 6 месяцев назад
thanks, exactly what i needed
@ferdikadatu687
@ferdikadatu687 9 месяцев назад
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.
@kasparsfolkmanis
@kasparsfolkmanis 3 года назад
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.
@guildaludica7013
@guildaludica7013 3 года назад
Great Job!
@markpaterson2260
@markpaterson2260 3 года назад
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 3 года назад
Thanks! Haha, everyone needs more Blanchealmond Mark :')
@kpackama8985
@kpackama8985 2 года назад
Very reasonable tutorial
@collinvisser7108
@collinvisser7108 3 года назад
Thank you for sharing this
@bananacomputer9351
@bananacomputer9351 3 года назад
Awesome!
@cmds.learning7426
@cmds.learning7426 4 года назад
great job
@fanuelanteneh8437
@fanuelanteneh8437 2 года назад
Thank you so much for this...
@mesolagic
@mesolagic 4 года назад
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 3 года назад
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:
@the_first_hunter
@the_first_hunter 4 года назад
Hey I upvoted your work on reddit! Good job man
@BramwellWilliams
@BramwellWilliams 4 года назад
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
@Crisisdarkness
@Crisisdarkness 3 года назад
Estimated Bramwell, I hope you come back, to continue making more content, I have missed you
@jesustzinon
@jesustzinon 4 года назад
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:
@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?
@moejoefree7222
@moejoefree7222 2 года назад
thank you
@thomasparas5668
@thomasparas5668 3 года назад
Dude, thanks.
@javvvv8120
@javvvv8120 3 года назад
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.
@timetorelaxfocus9642
@timetorelaxfocus9642 2 года назад
Thanks
@muerteplay3
@muerteplay3 5 месяцев назад
yep , this is the way
@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.
@capuchinosofia4771
@capuchinosofia4771 2 месяца назад
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.
@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 года назад
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 года назад
That's greatly appreciated and I will certainly bear that in mind, thankyou :)
@AlfredBaudischCreations
@AlfredBaudischCreations Год назад
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!
@ansel569
@ansel569 2 года назад
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 Год назад
Did you ever find a solution to this?
@syedrizvi6408
@syedrizvi6408 3 года назад
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 3 года назад
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 :)
@AmberLimShin
@AmberLimShin 3 года назад
Thank you for a thorough and straightforward tutorial! Too awesome not to subscribe :D
@really_damon
@really_damon 5 месяцев назад
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.
@slamtronx5834
@slamtronx5834 2 года назад
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!
@canaldosoninho
@canaldosoninho 4 года назад
I really want to play this game
@BramwellWilliams
@BramwellWilliams 4 года назад
Thanks! It's being a really fun project so I would expect something playable and more videos in the not too distant future c:
@ximipa1-32-noumisyifanabil3
@ximipa1-32-noumisyifanabil3 2 года назад
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?
@moritzbinnewei1347
@moritzbinnewei1347 11 месяцев назад
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.
@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 :')
@optionaldev2876
@optionaldev2876 4 года назад
sneaky style
@BramwellWilliams
@BramwellWilliams 4 года назад
Lol - btw love your videos!
@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!
@TheMM0123MM
@TheMM0123MM 2 года назад
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?
@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 года назад
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:
@FirstNameLastName-xl6hj
@FirstNameLastName-xl6hj 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
@ClassicMushroom
@ClassicMushroom 3 года назад
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 2 года назад
Did you find a solution?
@curlyboyoli6004
@curlyboyoli6004 3 месяца назад
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?
@safinmahmud5091
@safinmahmud5091 3 года назад
Very Cool!!! I,m curious that how to create code for dropping object(Building/Unit) from GUI to isometric or Tilemap place
@BramwellWilliams
@BramwellWilliams 3 года назад
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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Z0iNo9Q-cuU.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 :')
@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?
@MrRastastic
@MrRastastic Год назад
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
@facundogimenez9356
@facundogimenez9356 3 года назад
Hi! I'm stuck at 6:00 I have two problems, the first one is that the drop zones are not being colored properly, they are both white. The second problem is that in the script for the drag object it says "Invalid type in built-in function 'lerp'. Cannot convert argument 1 from Nil to float." This error comes from the else statement, I have this in that line: "global_position = lerp(global_position, rest_point, 10 * delta)" Everything is exactly as in the video and the script in your git. How can I solve this problem?
@BramwellWilliams
@BramwellWilliams 3 года назад
heya! that is peculiar, I'm not too certain about the first one, if you could upload what you have somewhere I'd be happy to download the project and have a look at it - as for the lerp problem, that sounds a lot like whatever node has that script on it doesn't have a global position, which would be the case if its a control node or a texturerect maybe? hope thats of some help :)
@boomerboyzr9612
@boomerboyzr9612 3 года назад
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 3 года назад
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!
@ansarheydar9353
@ansarheydar9353 2 года назад
I got this error in line 9 (dragndrop) invalid get index '0'(on base: Array).
@ValdaXD
@ValdaXD 3 года назад
This video explains basically the mechanics behind Ghost Trick. I've been hoping to make a game like that in the future. So this will be useful i hope. But i'm just too lazy to do graphics. But still great video ༼ ༎ຶ ෴ ༎ຶ༽
@stathisk2949
@stathisk2949 2 месяца назад
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 Месяц назад
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.
@kritantacrixus
@kritantacrixus 2 года назад
How to have multiple draggables? lets say i want to put 10 individual sprites? :(
@saluk7419
@saluk7419 2 года назад
Where is the console repair game? Looks fun!
@willaxesawian9242
@willaxesawian9242 3 года назад
NOTE: Just so you guys know, I encountered a bug (which unfortunately I do not know what the triggers for are specifically) when the code tried to find the global_position in the line for the 1st dropzone in: rest_point = rest_nodes[0].global_position in the ready function of drag and drop.gd For me it returned this error: invalid get index 'global_position' (on base: 'Position2D' (dropzone.gd) This I originally solved by asking for the global_position for the var rest_point on the line below instead, as I've had this problem before with Godot rest_point.global_position However this returned another error in the _process function, stating that lerp can't convert a nil argument (the rest_point) into a float For some reason commenting these two lines out to see if other parts of the code worked and then asking the game to print to console the global position of rest point in the ready function resolved (?) this problem, I can now run the code exactly as written in the video now with no problems Just something to be aware of if your having problems to get this to run
@BramwellWilliams
@BramwellWilliams 3 года назад
this sounds a lot like your rest_nodes list is empty when it shouldn't be -> are the rest nodes in the group with the correct name/ are you definitely running a scene with rest nodes and the dragable object? it may be worth downloading and trying out the project I put on github and see if that helps illuminate anything :)
@afroblueguy
@afroblueguy 3 года назад
Please make an inventory system tutorial
@abdulkadirwaziri2698
@abdulkadirwaziri2698 6 месяцев назад
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 4 месяца назад
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
@peoplearecool8766
@peoplearecool8766 2 года назад
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 2 года назад
So basically how to create dragging more fast and responsive
@sebcon952
@sebcon952 2 года назад
@@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
@ernestoaraujo
@ernestoaraujo 3 года назад
How to apply the tutorial for 3D meshes?
@Kaellrelth
@Kaellrelth Год назад
Help how do I move more than one sprite with that code? :(
@eruaiokoyomoh3177
@eruaiokoyomoh3177 4 года назад
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: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-SCHdglr35pk.html consider backbuffercopies in my backlog c:
@eruaiokoyomoh3177
@eruaiokoyomoh3177 4 года назад
@@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 года назад
Ahh I see, fiddley. In the circle wipe part of this video It should help explain making shader affects use your window dimensions :) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sZlX9o9uF7o.html
@borjadetorres7747
@borjadetorres7747 4 года назад
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 года назад
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 года назад
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 года назад
@@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:
@kito9690
@kito9690 3 года назад
how do I stop the object from going through collision areas?
@BramwellWilliams
@BramwellWilliams 3 года назад
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 :)
@Goldenfightinglink
@Goldenfightinglink 2 года назад
There's two type of tutorials. _unhandled_input or _inputEvent
@autumn20000
@autumn20000 Год назад
I did the exact same thing until at 4:29 my work mess up
@Game-made4you
@Game-made4you 3 года назад
its working to android?
@chepulis
@chepulis 4 года назад
Good video. I've been doing some similar things, here are a few notes that might be helpful to you: 1. Be aware of this bug: github.com/godotengine/godot/issues/38550 . Overlapping physics objects will grab the touch in a counter-intuitive and inconsistent order. It'd be great if you test and leave a note in the issue if you're encountering it too. 2. There's a natural latency to input, so you will have a kind of smoothing even without the lerping.
@BramwellWilliams
@BramwellWilliams 4 года назад
That's really appreciated thankyou! I will definitely dive into that bug I hadn't toyed around with multiple draggable objects too much so that's likely of great import
@opalakadewa4679
@opalakadewa4679 3 года назад
Hey do you know the workaround for the 1st note ?
@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.
@JiosX
@JiosX 2 года назад
Nice tutorial. Can't you make it any faster? I had to set my speed to .75 because of this
@ferdinandw.8952
@ferdinandw.8952 Год назад
you sound like braceys but for godot
Далее
Simple Glowy Aura Shader: Godot Guide
3:42
Просмотров 4,5 тыс.
I recreated Balatro's effects in Godot
8:04
Просмотров 24 тыс.
КТО ЭТО БЫЛ?
25:31
Просмотров 1,1 млн
Winning My First Ever Game Jam? | Godot Devlog
10:25
Просмотров 283 тыс.
Drag and drop in Godot part 1, UI Control nodes
13:36
We made Vampire Survivors BUT in 10 Lines of Code
7:08
Get This DIALOGUE System For Your Godot GAME Now
42:50
13 ADDONS to SPEED UP your game creation in GODOT!
11:23
Enums considered harmful
9:23
Просмотров 196 тыс.
КТО ЭТО БЫЛ?
25:31
Просмотров 1,1 млн