I added a sprint feature in my game that works if you hold left shift and when you let go the sprinting stops. Since this is not possible on mobile, how can I add a gui button that holds the left shift key if you press it and it stops holding it if you press it again vice-versa? If you have a solution, please tell me where to put the script in - the button gui's screengui or the button gui itself?
Taken from the dev forum. I don't think it's possible to hold the shift key directly, but you could run the function that makes you sprint when you press the button:
You can’t really force a key press, seeming as a key press
is done by a user - as such its their choice if they press the
key.
What you can do however is:
Act like they have pressed it, without pressing it. This is
simply done by calling the function / action itself.