EASY Drag and Drop for UI - Unity Tutorial

Uploaded by samyam
Share: Twitter Facebook
➡️➡️➡️UNITY BLACK FRIDAY SALE ⬅️⬅️⬅️
https://assetstore.unity.com/?aid=1101ljAbS
⏱️ November 14 21:00 PT - December 4 23:59 PT ⏱️

? Get the Source Code ?
https://www.patreon.com/posts/58469035

? Support Me ?
Patreon: https://www.patreon.com/samyg
Donate: https://ko-fi.com/samyam

►? Relevant Video Links ?
ᐅ(PREVIOUS VIDEO) Easy Drag and Drop with Input System 2D | 3D - Unity Tutorial
https://youtu.be/HfqRKy5oFDQ
ᐅRectTransformUtility.ScreenPointToWorldPointInRectangle Unity Documentation
https://docs.unity3d.com/ScriptReference/RectTransformUtility.ScreenPointToWorldPointInRectangle.html
ᐅInterface IDragHandler Documentation: https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.IDragHandler.html

►Assets shown in this video:
ᐅGUI PRO Kit - Fantasy RPG:
https://assetstore.unity.com/packages/package/id/170168?aid=1101ljAbS
ᐅAlien Fantasy Forest: https://assetstore.unity.com/packages/package/id/150615?aid=1101ljAbS
ᐅOdin - Inspector and Serializer: https://assetstore.unity.com/packages/package/id/89041?aid=1101ljAbS
ᐅHQ FPS Weapons: https://assetstore.unity.com/packages/package/id/177306?aid=1101ljAbS
ᐅDreamteck Splines: https://assetstore.unity.com/packages/package/id/61926?aid=1101ljAbS
ᐅFirst person narrative adventures + complete puzzle engine: https://assetstore.unity.com/packages/package/id/131623?aid=1101ljAbS
ᐅNature Renderer: Personal License: https://assetstore.unity.com/packages/package/id/153552?aid=1101ljAbS
ᐅThe Vegetation Engine: https://assetstore.unity.com/packages/package/id/159647?aid=1101ljAbS
ᐅExpanse - Volumetric Skies, Clouds, and Atmospheres in HDRP: https://assetstore.unity.com/packages/package/id/192456?aid=1101ljAbS
ᐅFantastic City Generator: https://assetstore.unity.com/packages/package/id/157625?aid=1101ljAbS
ᐅRPG Character Mecanim Animation Pack: https://assetstore.unity.com/packages/package/id/63772?aid=1101ljAbS
ᐅPOLYGON Dungeon Realms - Low Poly 3D Art by Synty: https://assetstore.unity.com/packages/package/id/189093?aid=1101ljAbS
ᐅAnimancer Pro: https://assetstore.unity.com/packages/package/id/116514?aid=1101ljAbS

This video shows an easy built in way to drag and drop a UI object in Unity. You can also drag and drop a 2d collider and 3d collider object by adding the respective Physics Raycaster components to the camera, however the actual logic for correctly dragging and dropping a 3d object taking into account perspective is not covered in this video. For more information on that refer to my previous video (https://youtu.be/HfqRKy5oFDQ). We use the IDragHandler interface and implement it. We then convert our mouse position which is in screen coordinates to world coordinates with respect to the RectTransform.

►⏱️ Timestamps ⏱️
0:00 Intro
0:13 Sponsored Message
0:43 Scene Setup
1:51 Drag And Drop
7:20 IBeginDrag or IEndHandler
7:44 Physics Raycaster for Colliders
8:41 Outro

??THANK YOU TO ALL MY PATRONS ??

❯❯❯ My Links ❮❮❮
? Patreon ?
https://www.patreon.com/samyg
? Discord Server ?
https://discord.gg/SwCKB3Q
? Twitter ?
https://twitter.com/samyam_utube
? Facebook ?
https://www.facebook.com/samyam.youtube/
? Music ?
Ambient Gold
streambeats.com
? Like and Subscribe! ?

?️ Computer Setup ?️
*As an Amazon Associate I earn from qualifying purchases.
https://www.amazon.com/shop/samyam

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we have recommended. While clicking these links won't cost you any money, they will help me fund my development projects while recommending great assets!

#madewithunity #gamedev #unity