- Home /
How can I move player sideways by dragging with mouse or with mobile device when pressed down?
I'm making a game, where the player goes forward and avoids the obstacles by going sideways.The movement I want is kinda like Rolling sky or Hop etc. I want, that if I press down and hold the mouse1 or the screen on mobile, I can move sideways by dragging and if I release the mouse1 or screen, it doesn't move sideways. I already know the Input.GetAxis(Mouse X) and float X..., but it doesn't work on mobile and it's easier, if the player moves only when I press down. How can I do that? What is the script? Any help is appreciated.
Comment
Your answer
Follow this Question
Related Questions
Jump Script for 2D (JavaScript) 0 Answers
Android Controls Help! 2 Answers
Grid Movement Controls on Mobile - UX Problem 0 Answers
What are the best android phones for developing games in unity3d? 1 Answer