Unity Tutorial - Drag and Drop Game Objects With Touch using C# Coding

preview_player
Показать описание
Link to the source code -

Welcome to the second Unity mobile programming tutorial. In this one we will explore how to touch and drag game objects in Unity. We will not be using any added unity assets for this project we will be writing all of the code ourselves and explore how to work with multiple objects inside of a unity scene and how to work with them so you can touch, select and drag a object to another part of the scene.
Рекомендации по теме
Комментарии
Автор

Had to set to camera as public gameobject to reference it properly, now it work perfeclty, thanks ! (2020.3.11f1 URP)

skudgee
Автор

Just what i needed! thank you so much! will subscribe!

dappu
Автор

you have helped 10k people man. thanks a lot

hoursago
Автор

Thanks so much this is really helpful indeed. Thanks. One question though. I followed your tutorial step by step and it works fine, but when I turn my phone horizontally the drag still responds like it's vertical. How can this be corrected please?

aiyewatughu
Автор

Finally Unity tutorials from you <3

sret
Автор

Does it work if we have applied gravity on cube?

thedestinators
Автор

It was very helpuf. Thank you a lot! God bless you

YuraBazhan
Автор

Hello, if you click on two Cubes with two fingers, can you move them synchronously? ✌️🔷🔶

lora
Автор

but when i drag the object from its back, it moves in opposite direction. suggest me changes in code.

thedestinators
Автор

Hi. Sir. How call difference tags?
If not cube object only as sphare or capsule

ivosugianto
Автор

Can anyone help me?
I want to adjust the settings of the game controls, it is for Android
The settings are such that the party can move the fire button and customize it as he likes

zerop
Автор

How to convert it into unity 2d? I need to drag and drop multiple 2d gameobjects. Can someone help please?

NainDevs
Автор

Why Touch doesn't get the input on computer? Or is there an easy way to use only computer for testing such thing?

alperenuzun
Автор

Could you explain to me how to flip a character so when I press left arrow key it flips the image to the left and vice versa. Or link my a video where you explain this.

Luc-mkhi