I need this to work on mobile

I want to achieve a double jump bar that works on mobile.
The issue is it does not work on mobile.
I have checked and it only works when you press the space bar.

userInput.InputBegan:Connect(function(input)
	local input = input.KeyCode
	
	if input == Enum.KeyCode.Space then
		jumpEvent:Fire()
	end
end)

thank you

This says it work’s on mobile, title says otherwise. Anyways try reading this.

userInput.InputBegan:Connect(function(input)
	local input = input.KeyCode
	
	if input == Enum.KeyCode.Space then
		jumpEvent:Fire()
	end
end)

Do you mean:
I want to achieve a double jump bar that works on mobile.
The issue is it does not work on mobile.
I have checked and it only works when you press the space bar.

1 Like

yes that is what i mean do you know how?

Try this:

i have tried it but i dont seem to know why

But the code you showed doesn’t include that.
It has to be run in a localscript as well.

I believe what @Scottifly is trying to say is the key code in the script you showed us only work’s with a spacebar.

yes it does but how do you make it work on mobile

There’s a script on that page that shows you how to detect if someone is jumping whether they are on keyboard or touchscreen.
Incorporate that instead of the code you are using. You will have to tweak it, but it should all be there.