Advanced Drag & Drop system for your Game in Unity!

preview_player
Показать описание
Let's make a complete Drag & Drop system in Unity, working on both Computer and Mobile (Android, iOS) with extra features such as:
1) Avoiding overlapping items by repositioning in the closest valid position
2) Snapping inside another item if the drop is valid
3) Going to the starting position if the drop is not valid

_______________________________
Hit like and subscribe for more content! :D

You can also follow me on the other platforms:
_______________________________

TIMESTAMPS
0:00 - Introduction
0:41 - Auto reposition to avoid overlapping
3:20 - Valid and Invalid drop handling
4:48 - Epic fail - Use contants!
5:04 - Final demo
5:25 - Like and subscribe
Рекомендации по теме
Комментарии
Автор

Let's do some networking guys! :)

See you there!

DevLeonardo
Автор

Thank you. Your voice and attitude is so chill - I really enjoyed this tutorial.

aliadjorlu
Автор

What's up, GameDevs?
I'm sorry if it took a little bit longer than expected to publish the second part of the tutorial, but finally, here it is!

Feel free to suggest any topic for future videos, I'd like to give priority to community request :)

See you in the GameDev journey!

DevLeonardo
Автор

Late comment, but if it helps anyone - when setting the Dragging layer number in Layer at the very start of the video, make sure the number you set matches the layer number in the inspector! I just picked a random slot and didn't realise the number coincided with what is typed into the Layer script! DevLeo used slot 8 so in Layer script it must say slot 8 not a different slot etc.

isolid
Автор

Great Tutorial, thank you so much for sharing it with us!

carlescolomarcalatayud
Автор

Hey! not sure but on my side, i have a Bug where in, while collision, it doesn't update the Item to Move away from each other, it only updates when i click on another game object.

cryo
Автор

Bernardo, now I have a question about your video:
1 what to add to the script so that the sprites are very smoothly attracted(glued). Was smooth pull (sprite gold)? And:
2 What and where to change in the script so that the gold (sprite) can no longer be pulled out of the box. So that two sprites (gold and a box) become like a background?

lora
Автор

hello! thanks for the great video ! just wanna ask, for the image that we want to drag, is it need to choose image in UI at the hierarchy at the left side? hope you'll answer this. thanks :))

husniyahazman
Автор

Great video!

I have an issue with my sprite snapping to a z location off screen when i click down, in the inspecter its last position is z -641009.9 every time (no console errors and scripts, tags, rigidbodys, and colliders attached). Any ideas and Id be exceedingly grateful haha :)

julianbridges
Автор

hey i have a question on how do I want to make, for an example i want to make gem can only insert at green but not at red and the coin can insert to red but not at green ?

eyyosyber
Автор

Is there a way I can skip the auto reposition part? thanks.

nghtrunnr
Автор

how do you make the sprites position stay inside the screen space of any resolution or size screen?

aussiedev
Автор

Doesn't work. The colliding of two object doesn't work at the end of the drag, it works at the start of one.

ginsengjin
Автор

Hello
How to make a sprite come to the front on mouse click? Please 🙏

lora
Автор

How... Drag & Drop way of system UI

NUZASARY