Hey ! So i’m working on a custom movement system and while it’s easy to detect keycode from keyboard, I struggle finding it for mobile players.
I need to detect when the player wants to move up down left or right
Since on mobile we have the dynamic thumbstick :
I’d like to detect when it is used then find it’s position or delta
but here’s where I struggle : I can’t seem to detect when the thumbstick is being used.
this person suggested to modify playerscripts on this post
But it doesn’t seem to be the most optimal solution. I’m not even sure how to do that, i guess i could copy it then modify it and change the module but it’s overcomplicating everything.
Do you have any ideas ?
PS : GetMoveVector or Humanoid.Movedirection won’t work since controls are disabled
I know that you are also able to access the TouchGui, which appears in the PlayerGui when the last input type is touch. However, there are no buttons inside it apart from the jump button, there are only the frame and images of the thumbstick control.
I just noticed that the StickImage’s offset position changes whenever you use the thumbstick, so you may use that to check the direction. (I don’t know if it works with disabled controls though)
What do you mean controls are disabled? I’m pretty sure I just used Humanoid.Movedirection to detect dynamic thumb stick for mobile players in a game I made a while ago
I already suggested that in the previous post, and the OP mentioned that it doesn’t work since the controls are disabled. This is also specified in this post.
Controls were disabled by unbinding ControlScriptRenderStep from RunService, which means that using the thumbstick no longer changes the Humanoid.MoveDirection.
I disabled them so controls are disabled, and humanoid.movedirection does not detect the dynamic thumb stick but the desired movedirection when controls are enabled (so yes it works when the hrp is anchored but not for what I want to do)
Hey ! So that was a pretty good guess.
For anyone wondering, in a localscript find the dynamicthumbstickframe in PlayerGui.TouchGui.TouchControlFrame.DynamicThumbstickFrame (using waitforchild)
then check touch input on it using dynamicthumbstickframe.InputBegan to set its startposition, and in your inputchanged function get the direction using delta.
don’t forget to reset the startposition when the inputended and tada, you’re done.
you could also use runservice if you continuously need a value.
Also in my case, it works with disabled controls, only because I disabled them using RunService:UnbindFromRenderStep(“ControlScriptRenderstep”).