This Unity tutorial explains how to Rotate Object With Mouse Drag Relative To Scene Width In Unity.
When you press the left mouse button, the game object will be rotated by the ratio of relatively the mouse move distance to the scene width applied to 360 degrees. This can be used for wheel or steer rotations. If you want a 2D rotation implementation, you can transform this logic to 2d rotation.
I had used a similar approach for steering the ship for a prototype so here we are.
0:00 Intro & Demo
1:01 SteerRelativeToScreenWidth Script Walkthrough
3:32 Small Devlog & Outro
#Rotate #MouseDrag #SeceneWidth
Models from Kenney Pirate Kit https://www.kenney.nl/assets/pirate-kit
If you want to see more of this kind of videos, please give this one a LIKE and SUBSCRIBE for future ones. Comments are always appreciated.
If you are new here check out the CHANNEL TRAILER:
• Welcome To Devsplorer | Game Dev Chan...
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 Great Day!