Unity Drag and Drop Script | (Unity 3D tutorial)

preview_player
Показать описание
In this session, we'll walk through how to create a c# script that will allow us to drag and drop 3d objects in Unity. To illustrate our script, we'll assemble a small puzzle. Before you leave, hit those like and subscribe buttons, it helps the channel a lot and it's absolutely free. And as always, the link to the source code is available in the description.

► Socials

For more educational content on video game development, unity tutorials, and c# programming don't forget to subscribe!

Chapters:
0:00 Introduction
0:27 Overview
0:50 Setup
2:15 Creating a unity drag and drop script
5:21 Picking up and moving a 3d object
9:23 Dropping a Unity3d object during run time
10:50 Rotating a Unity3d object during run time
12:08 Outro
········································­­·······································­·­····
****
****


#unity3d #unitytutorial #gamedev
Рекомендации по теме
Комментарии
Автор

I had a lot of fun creating this little puzzle game. I implemented a snap and lock for when puzzle pieces are placed and oriented in the correct spot. Are you interested in seeing a tutorial on that?

AIAdev
Автор

You got everything to grow into a large dev channel, chapters, calm voice, sweet music, sub 15 minutes videos. I subbed !

minia
Автор

This was great! I watched a number of tutorials doing similar things, but this was the best of them. In particular, this implementation allows easier drag/drop movement along the z-axis. And if anyone is struggling with the object shaking, just tick 'is kinematic' on your rigidbody, if you're using one.

martybonus
Автор

I yelled at my screen when you copy pasted code. Then I felt satisfied when you told the audience to refactor it!

ChrisKarpyszyn
Автор

Great tutorial, very easy to follow, even an idiot like me can (probably) do this correctly now. Pretty cool!

punkrockprincess
Автор

great video!! yo have a video doing the puzzle pieces?

darvinnunez
Автор

This video helped and I am commenting down below as a result.

aidev
Автор

This is an amazing tutorial and it really helped. However, for me, it doesn’t work with objects i imported from blender. Do you know how to fix this?

mikeyrichards
Автор

The background music is so chilling, it really sets the vibe! Anyone know the name of this instrumental track?

PowBro
Автор

Hi! How did you make such puzzle pieces?) How were you able to apply texture to them? Please answer)

Dumkras_old
Автор

How do i get my object to snap to the 'board' when dropping like yours?

zYiVIDS
Автор

Hi, I just got your script, it's great, but how can you get the whole project?

PlanshetkaCom
Автор

Great vidéo ! Thank you for this tutorial. How can i snap my objects on a board now ??

tibd
Автор

Thank you so much for this video! I am working on a very small game where you organize your desk and it works great. I have an idea though but not sure how i'm gonna accomplish that so i'm asking the question here. I want to be able to cycle through different models when i have picked it up. For example; i have picked up a flower pot, but i don't want it to be a cactus in the pot, i want a red flower, so i press space to cycle between different flowers. My first thought is that i should make the other meshes as children to the flowerpot and then cycle through visibility.

SpaceMango
Автор

Hey! Love the video, perfectly explained! Is it possible to just turn the axis so that i can move my objects like on a wall? I tried to change the Vector3's but it won't work.

splican
Автор

Is there a way to pick and move only a copy of the selected game object? I am looking to create an interface that can allow the user to select from a variety of different options, and I want the set of options to remain fixed.

TheLespauljunior
Автор

hello, does this still work on a new system?

hayewolf
Автор

Nice tutorial please can i have the 3d models you use in this tutorial

younesbelhit
Автор

implementation and not work stop name it tutorial. wasting 12 mnt time

earpgth
welcome to shbcf.ru