Roblox Speed build-up mobile issue

Hey everyone, I’m facing a small script issue where:

  • This is a script which build’s the players speed overtime while they are running.
  • For now there’s a bug which for some reason (I think has to do with mobile joystick) causing mobile player’s humanoid to not increase in speed
  • Works fine for pc just mobile.
  • Animation tracks and everything work for mobile, just the walkspeed isnt updating.
[code redacted]
1 Like

Shoud’ve said a bit more informatio sorry, the attribute “SpeedOn” is the mobile support, this helps to check if a text button has been pressed, if so it creates the attribute in which this script connects.

The joystick shouldn’t be interfiering with editing WalkSpeed. I know this is what you probably did but did you try checking if the SpeedOn is true and are you doing :GetAttribute("SpeedOn") on the right instance.

Instead of doing:

if condition == true then
	-- code
end

if condition == false then
	-- code2
end

You should do:

if condition == true then
	-- code
else
	-- code 2
end

So that the interpreter doesn’t have to spend time doing 2 checks instead of just one.

2 Likes

Hey there, thanks for replying. I’ve tried this already and it still doesn’t seem to change the WalkSpeed. Everything still prints correctly in the output e.g "WalkSpeed increased from 160 > 160.4" it just doesn’t seem to actually change the base WalkSpeed on mobile

My bad I read this wrong, it works. Thank you very much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.