I am creating a custom thumbstick to move characters in my game. What I want to know is how can I make the character walk in the direction I want?
Properties like Humanoid:MoveTo()
or Humanoid:WalkToPoint
doesn't seem accurate, because the Humanoid will stop whenever it reaches the point. I need the Humanoid to keep walking until the user release the thumbstick.
What is the best way to make the Humanoid walk until the thumbstick key is released?
Heres a solution that SHOULD work pretty well.
Create a while loop
that checks if the player is walking. If they are, the while loop starts. It would then slightly set the player's WalkToPoint
position in that direction.
Since a while loop only runs when a condition is true, it would stop setting the player's walk to position when they lift their finger from the thumb stick. Since you are setting a new position every increment (like maybe 0.125 seconds or so) that only moves them by lets say 2 studs, the player SHOULD end up going in that direction while the player tries to move them, and within a fraction of a second stop moving right when the thumb stick is released.
Hopefully this makes sense and helps you, it's my first time answering a question so I don't know exactly how its supposed to look. Good luck!