- Home /
Moving an object on the X axis corresponding to mouse movment
Hi all,
first question here, so sorry if its a stupid one, but I have searched the answers with no luck.
I was playing around in Unity, self teaching with youtube and forums, but one thing I couldn't figure out is how to get an object to move along the X axis with the mouse movements. ie: if i move the mouse to the left, the object will follow it to the left; if I move the mouse to the right, it will follow it to the right.
I have no working code, sorry. All I have is an isometric view on a never ending plane.
IDEA: I am trying to make a game where you slide the ball from left to right on on the x axis corresponding to mouse movement (left and right) while dodging cubes moving towards you.
If anyone could so me how to do this, it would be greatly appreciated. And if possible, a bit of detail on what bits do what and such.
Cheers and TIA.
Your answer
Follow this Question
Related Questions
Unity 2D: move towards mouse and through mouse 1 Answer
moving an object with mouse ( my script is not smooth enough ) 0 Answers
2D Isometric Game Setup 0 Answers
How can I drag a GameObject along a fixed line? 2 Answers
Making my 2d character's arm follow the mouse, scrpit not working, please help :c 1 Answer