Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Drag drop game objects (without rigidbody) with the mouse

$
0
0
I've searched and read, but haven't found any satisfactory answers..

Lets say I have a clean project. I add a cube. When pressing play in Unity3D I want to move this cube with my mouse. Pseudo code:
Code (csharp):
  1. function OnMouseDrag() {
  2.   // move gameObject along with the mouse
  3.   // transform = Mouse.transform ??
  4. }
There are no rigid bodies involved, so I'm guessing this should be fairly simple without a lot of code?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>