How to convert and use mobile thumbstick input to directions

Hello! I am working on mobile support for my game!

  1. What do you want to achieve?
    In my game, players control a part. I set this up using directions (right, left, up, down and right, etc.) on keyboard. How can I set this up for mobile?

  2. What is the issue?
    I do not know how to do this, and am wondering if anyone knows.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Please note: I have searched for solutions, and I have recognized an issue. I have disabled character loading. Does anyone know how to do this?

Thank you everyone!
Someperson576

1 Like

Isn’t this for a console controller?

1 Like

Edit: This reply was meant for OP in regards to the info MrLegendaryDoge supplied.

The wiki is actually unclear regarding how to get a mobile thumbstick orientation. This is actually really troubling considering similar functionality exists for gamepads…

But anyways, there is a way the wiki sort of hints towards, and that is using GetLastInput. You can find more here on the different inputs you can check for, but GetLastInput should tell you what the player is using (and hopefully the position of the thumbstick, but I cannot vouch for this since I haven’t tried it). Give it a try and let me know if it works out. You may need to look for additional resources if it ends up not working, or perhaps someone with more knowledge can help you figure out the small details.

Good luck!

Sadly, It only returns the touch input.

1 Like

It appears that:

require(player:WaitForChild("PlayerScripts").ControlScript:WaitForChild("MasterControl")):GetMoveVector()

Works. However, how would I make this live updating? It converts this to a Vector3, but I still need to round it to Right, Left, Up, Down, Up and Right, etc.

Does anyone know how to do this?

1 Like

Ok, but I currently put the line above in an Input Began line, how could I keep track of the mobile input constantly?

Also, does anyone else have another, or a better, way of doing this?

What would this look like? I also want to make sure that it doesn’t conflict with the keyboard input system.

I finally got this to work using I modified version of tracking the thumbstick gui position. Thank you all for your help!