How To Move Objects With Mouse Drag in Unity | Unity 3D Tutorial

Опубликовано: 03 Октябрь 2024
на канале: Devsplorer
19,657
156

This Unity tutorial explains how to Move 3D Objects With Mouse Drag in Unity using OnMouseDrag event and WorldToScreenPoint and ScreenToWorldPoint camera functions.
When a 3d game object is pressed on and the mouse drag started, the pendicular distance between the game object and the camera's XY plane will not change and the game object will be moved to where the mouse is on the screen using space transform methods and OnMouseDrag event.

Videos Related To Dice Series:
Set Random Color To Materials
   • Random Color In Unity Using Gradients...  
Detect Upper Face Of Dice Tutorial
   • Detect Upper Face Of Dice In Unity Us...  
Move Objects With Mouse Drag Tutorial
   • How To Move Objects With Mouse Drag i...  
Rotate Objects With Mouse Drag Tutorial
   • How To Rotate Object With Mouse Drag ...  

0:00 Intro & Demo
1:27 Environment
2:02 Move Object With Mouse Drag
6:50 Outro
7:16 Future Plans For Dice Series

#Move #Object #MouseDrag

Script for Move3D behavior:
https://gist.github.com/seferciogluec...

If you are new here check out the CHANNEL TRAILER:
   • Welcome To Devsplorer | Game Dev Chan...  

If you want to see more of this kind of videos, please give this one a LIKE and SUBSCRIBE for the future ones. COMMENTS are always appreciated.

I hope this will help you and if there was a point not clear let me know in the comments.

Confetti Particle System With Default Unity Assets | Unity Particle System Tutorial
   • Confetti Particle System With Default...  
Divide Cubes Into Smaller Cubes Using Transform Functions In Unity | Tutorial
   • Divide Cubes Into Smaller Cubes Using...  
How To Make Automatic Shooter In Unity | Spawn & Shoot With Physics | Tutorial | One Script
   • How To Create Auto Shooter In Unity |...  
Simple Drag & Shoot mechanics developed with Unity,
   • How To Drag And Shoot 3D Objects in U...  
SteamVR tutorials,
   • Unity SteamVR Setup For Unity 2019 | ...  

Here are some written tutorials https://devsplorer.wordpress.com/
I generally share sneak peeks to next mechanics:
Twitter:   / eccegd  
Instagram:   / devsplorer  

Also, If you would give feedback on the overall performance of the video you would make me very happy. I plan to make more videos and want to improve along the way and each feedback is very valuable.

Thanks for reading up to this point and see you in the next explorations :)
Have a rotating day!