0

Is there better way to create top down player movement using one button. In position1 player don't move. as the button drag toward any direction player should move to the same direction and rotate to the same angle. What is the best way to do this. It's for top-down mobile game. Like in the image there will be a button(controller) that control the player movement and angle. also I'm new to coding and started to learn few days ago.

enter image description here

  • You seem to be describing an on screen joystick. Which is a common input solution for touch. You can find examples and tutorials online that explain it. You probably don't want to use that if the game is intended to be played with a mouse. Which, I don't know, you didn't tell us. Regardless, what is the best way will probably fall down into opinion based. If you want to ask about what input system fits your game, https://gamedev.stackexchange.com/ is a better place. And you would have to provide more details. For this site… What did you try? Did you run into trouble trying to implement this? – Theraot Jul 28 '21 at 01:43
  • It's for top down mobile game. Like in the image there will be a button(similar to a controller). When you click and drag the button, player will move to the direction you move the button, and the player angle is equal to direction of the button(from center point ) . – MoonLightKnight Jul 28 '21 at 02:07
  • Sounds like you have a plan. And, yes, it should work. If you ran into some problem, or for some reason it is not working, please add that to the question. I'll also mention that we don't want to incentivase using the site to just have some developer implement something. On a similar note, asking for tutorials is off-topic, but I assure you that you can find them by a regular web search. Thus, I want to encourage you to give it a try. – Theraot Jul 28 '21 at 08:01

0 Answers0