Тёмный

Easy Drag and Drop with Input System 2D | 3D - Unity Tutorial 

samyam
Подписаться 85 тыс.
Просмотров 30 тыс.
50% 1

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

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 66   
@LoriGriffiths
@LoriGriffiths 2 года назад
Amazing tutorial. Clear and to the point without sacrificing any needed explanations. You're a great teacher. I'm working on my first project in Unity and you answered so many questions for me. Thanks for taking the time to make videos and sharing them with all of us.
@samyam
@samyam 2 года назад
Thanks so much for the nice comment!
@lovelyanne0
@lovelyanne0 Год назад
honestly one of the more well thought out and explained unity tutorials ive watched, i learned so much from this
@plasticflower
@plasticflower Год назад
Good tutorial. Some of these functions are really obtuse and impossible to figure out without good documentation or tutorial. I mean, for example why do they store whether the mouse button is clicked or not as a float of all things? As if there are any analog mouse buttons...
@ymarcellus6763
@ymarcellus6763 2 года назад
Hi Samyam,, Great tutorial - it's clear, to the point and well-conceived. Keep up the good work! Quick question - How can I use this script on an imported OBJ object? It works fine with native Unity objects but does not seem to work ( at least for me ) with imported ones. Any help would be appreciated.
@codeFriendlyART
@codeFriendlyART 2 года назад
Thanks a LOT for this video, I was looking exactly for how to work out this functionality on the new Input system. This video was so well layered out and explained, that not only it gave me a lot of insight about the subject, but also really specific techniques while at it as well! Really appreciated!
@samyam
@samyam 2 года назад
Awesome! Glad you found it useful :)
@ArtRiku
@ArtRiku 10 месяцев назад
Just so you know, this doesn't seem to work with 2D skined characters/object. I don't know why.
@razan_psut
@razan_psut Месяц назад
hi i tried posting in your discord server but i copied the code and debugged the raycast, but the raycast isnt hitting anything, would you happen to know why that is?
@dezikso9358
@dezikso9358 10 месяцев назад
I have this problem where every time I click on an object it moves further away from the camera
@DonDisainer
@DonDisainer Год назад
dammm this tutorials are the best, hope you dont leave unity :((
@afrakes4510
@afrakes4510 Год назад
Thanks again. Your vid start out with great topics, but often lean into needless complexity. Good vid, but tmi for grasping input systems usefully. This example would change the flow of most code but beggars aught not be choosers,. >KISS > 1.Keep.2.It.3.Simple.4.Stupid!
@racrity
@racrity 6 месяцев назад
Damn this was good as a cold beer en la playa babe! tysm!
@giorgostrc6878
@giorgostrc6878 2 года назад
This was very well explained and although quite up-tempo, very informative. I understood your code fully and was able to replicate it. I'm not sure I'd be able to do it on my own though. How do you get this good at this?
@samyam
@samyam 2 года назад
Lots of practice and experience! Glad you liked the video :)
@oingomoingo7411
@oingomoingo7411 9 месяцев назад
typed way to fast but other than that its good
@dashromero6615
@dashromero6615 2 года назад
Quick question, but how could I get this working on touchscreens?
@samyam
@samyam 2 года назад
You can replace the mouse coordinates with your finger coordinates! I have a video here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ERAN5KBy2Gs.html
@為什麼要翻譯我的名字
@為什麼要翻譯我的名字 2 года назад
​@@samyam If I do that, will I be able to drag multiple objects then at the same time using multiple fingers? I want to know before I start implementing that.
@julmardelima6055
@julmardelima6055 2 года назад
Great Video! I have a question: Will this code work if I build and run it on the android platform? Thank you
@MarekNijaki
@MarekNijaki 2 года назад
Awesome stuff, but I have a question: if we want to not move object along depth axis, eg z how to do that? Get angle between last two rays and using trigonometry get new position of object?
@samyam
@samyam 2 года назад
If you aren’t using physics you can set the z position to equal the previous z position of the object. If physics you can lock the Z movement constraint in the Rigidbody component settings docs.unity3d.com/ScriptReference/Rigidbody-constraints.html
@MarekNijaki
@MarekNijaki 2 года назад
@@samyam I think I didn't explain it fully: the main problem is if you lock depth axis movement of dragged item, it is not fully following cursor, the farther you go towards edges the more it stays behind. My assumption was it is because ray should become longer if you move from center of screen towards edges That's why I thought I have to use some geometry algebra . Am I correct?
@andreyradostny
@andreyradostny 5 месяцев назад
My MousePressed() function just doesn't trigger. mouseClick.performed doesn't trigger? I put Debug.Log("!") in the function and it keeps silence (( Can't figure out where is the problem :(
@andreyradostny
@andreyradostny 5 месяцев назад
Oh, God, I added Binding to the MouseClick action while PlayMode was running, so it wasn't saved
@jbaidley
@jbaidley 2 года назад
Why do you prefer comparing ReadValue() to 0 over using the IsPressed() method?
@DemersCreations
@DemersCreations Год назад
How do stop from being able to fling items across the map? For instance I want it so that as soon as I stop dragging, the item stops and drops to the floor.
@ralphm.881
@ralphm.881 2 года назад
Thank you so much! Implementing this functionality with the new input system was driving me nuts for days! This worked perfectly!
@ClassicGameSessions
@ClassicGameSessions 2 года назад
Great Unity tutorial - well articulated and helpful!
@samyam
@samyam 2 года назад
Thank you!!
@busynessy798
@busynessy798 Год назад
Great video, it's very informative. Thank you !
@kyleme9697
@kyleme9697 2 года назад
Wow do you ever pack a lot of material into 20 minutes.
@dr.araujo-junior
@dr.araujo-junior 2 года назад
Thank you SO MUCH! Keep up the excellent work!
@hubbubbobbin
@hubbubbobbin 10 месяцев назад
Thank you for the video!
@JetBlackJester
@JetBlackJester Год назад
Which binding(s) do we use for touch?
@miaoumixed4268
@miaoumixed4268 2 года назад
Hi, thank you for this video, very useful. I just have a little problem, I can drag the floor which has no tag, no layer, no script. Can't find why, my "if"s look like yours. M. D.
@allengrayeg.tuates1071
@allengrayeg.tuates1071 2 года назад
the "{" open bracket sign is in the side if close parenthesis
@isabel7213
@isabel7213 Год назад
queen of uncomplicated tutorials 💘
@ironcladvr
@ironcladvr 2 года назад
Oh I'm actually learning this and the UI drag and drop. I look forward to it!
@freestylerak6655
@freestylerak6655 Год назад
Does this work in unity 2d?
@IcelandicCello
@IcelandicCello Год назад
Amazing tutorial, thank you so much. However, I keep having this error with your script....:Assets\DragandDrop.cs(7,6): error CS0246: The type or namespace name 'Serializefield' could not be found (are you missing a using directive or an assembly reference?) And when I use public variables instead, it does seem to work, but at once I fall through my terrain when I click on any layer other than draggable... Would anyone have a suggestion?
@samyam
@samyam Год назад
SerializeField - caps sensitive Thanks!
@IcelandicCello
@IcelandicCello Год назад
@@samyam Thank you so much, you are my hero of the day!
@myfufina1
@myfufina1 2 года назад
Helped me a lot! just one note, you need to add a collider programmatically if you have a custom mesh added at runtime.
@davidReyGD
@davidReyGD 2 года назад
Thank's a lot for your tutorials @samyam. And thank's Google for recommending me this channel :)
@samyam
@samyam 2 года назад
Yay! Thanks so much 😄
@ARabbitGuy_
@ARabbitGuy_ 2 года назад
Saving this 4 later
@thealetree
@thealetree 2 года назад
Super supremely awesome. Definitely subscribed after this video.
@samyam
@samyam 2 года назад
Thanks!!
@rebarius
@rebarius 2 года назад
Easy Peasy Lemon Squeezy 😎🤝
@andrelima.2190
@andrelima.2190 2 года назад
Does it work with touch too?
@normalguy282
@normalguy282 2 года назад
Looks cool:3
@santinafortuna1699
@santinafortuna1699 2 года назад
Very helpful tutorial! 😊 I would like to ask you how I could scale or rotate an object using the Input System
@samyam
@samyam 2 года назад
Thanks! You can access other mouse properties, here’s a list: docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.Mouse.html And change the transform of the object respectively. Or you can use an Input Action Asset to store your actions and then read those values ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-m5WsmlEOFiA.html
@santinafortuna1699
@santinafortuna1699 2 года назад
@@samyam Thanks! I will try to do it as soon as possible 😊
@darkdoom907
@darkdoom907 2 года назад
Will this work with touch Screen?
@minecraftguide6338
@minecraftguide6338 2 года назад
No, this is only for cursor.
@allengrayeg.tuates1071
@allengrayeg.tuates1071 2 года назад
HOW TO RUN THIS IN ANDROID
@samyam
@samyam 2 года назад
You'll need to add touch input to your actions, I have a video on Touch Input that might help you: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ERAN5KBy2Gs.html
@sameuntaekkim1493
@sameuntaekkim1493 2 года назад
21:47 thats me beaches
@samyam
@samyam 2 года назад
Hehe thanks for the support!!
@pharos640
@pharos640 2 года назад
Great tutorial I learned a lot today.
@samyam
@samyam 2 года назад
Awesome! Glad you liked it 😁
@derekdipietro9805
@derekdipietro9805 2 года назад
Is the picture at the end actually you? Also, kudos for the hidden leaf shirt I dig it. Thanks for the tutorial I learned a lot!
@samyam
@samyam 2 года назад
Thanks! Yes it’s me, probably was at my Naruto phase 🤣
@derekdipietro9805
@derekdipietro9805 2 года назад
@@samyam Nothing wrong with a Naruto phase, it's a great little story. You rock!
Далее
EASY Drag and Drop for UI - Unity Tutorial
9:51
Просмотров 18 тыс.
Bearwolf - GODZILLA Пародия Beatrise
00:33
Просмотров 359 тыс.
How to Drag and Drop UI Images in Unity (Simple)
4:46
Просмотров 1,9 тыс.
How to use TOUCH with the NEW Input System in Unity
24:11
EASY DRAG AND DROP IN UNITY - TUTORIAL
8:52
Просмотров 10 тыс.
choosing a game engine is easy, actually
15:08
Просмотров 503 тыс.
Drag and Drop for Mobile & Desktop in Unity
6:54
Просмотров 35 тыс.