- Home /
Select/Drag/Drop Objects with a mouse
Hi,
i've went over dozens of examples how to do this and still i am unable to make it work the way i want to.
Here is what I am trying to do..
the scene has few objects (cubes) on a larger cube (a floor). I want to be able to pick up a cube and move it to a different place.
What i managed to do is to pick it up and drop it somewhere, but it has a problem.. the cube is not following the mouse "naturally"...
at some point the mouse is not over the cube anymore and so the cube position does not corresponds to the mouse position..
this movement would work if you are looking with a top down camera.. since there is no angle to speak of so the 2D mouse movement is easily translated to the 3d world since its more or less just x,y or x,z coordinates..
and soon as you make the camera "isometric so to speak", give it an angle (like in strategy games, the script does not work properly anymore..
does anyone even understand what i am talking about ?:) even better if someone could help me, or point me in the right direction..
thank you all!
Share your code and current solution so we can help you find what's wrong.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Erratic movement problem 2 Answers
Move camera with mouse (2D) 1 Answer
c# scripting navigation problems 1 Answer