Character Moving slow on XBOX and Mobile when using moveto

Hello, i am working on a game called Would You Rather, when players choose one of the 2 options the system moves the user, Whenever i am using a controller or mobile it will move slow, its not touching the walkspeed or something, How could i fix this?

Heres a gif of what i mean

I believe this is caused by the mobile/xbox joystick controls altering WalkSpeed when not fully walking in a certain direction. Try setting their WalkSpeed to 16 before/while using MoveTo.

1 Like

Following on from what @Starception was saying, it might be that the joystick and thumbpad controls are constantly setting their walkspeed to 0 if there is no input from the player. Try disabling this script and running the moveTo function. It might help.

1 Like

thats not the case because i disable the character controler once i start moving the user, and the walkspeed is still 16

Any solution found for this issue yet?

^^
Any solution found for this issue yet?

I’ve had this issue before, I think it has something to do with the last known Walkspeed of the player (which can vary based on the position input). From what I recall it was usually going slow but at slightly different speeds. I’m surprised that setting the WalkSpeed to 16 and then immediately calling moveto doesn’t work. Maybe try adding a Boolean variable to the humanoid and only tracking input based on that rather than disabling the script?

I wasn’t using walkspeed, I disabled fully the controls. And enabling them when the user I allowed to walk

Here’s a fix to this.

Step 1:
Go on studio press play, go to Players[Player Name].PlayerScripts and Copy “PlayerScriptsLoader” and “PlayerModule”

Step 2:
Stop the session, and paste into Starter Player > Starter Player Scripts

Step 3:
Open PlayerModule.ControlModule.DynamicThumbstick
Find this code:

currentMoveVector = currentMoveVector.Unit*(
1 - math.max(0, (self.radiusOfMaxSpeed - currentMoveVector.magnitude)/self.radiusOfMaxSpeed)
)

and replace it with the following

currentMoveVector = currentMoveVector.Unit

Step 4:

Open PlayerModule.ControlModule.Gamepad

Find the following code:

if inputObject.Position.magnitude > thumbstickDeadzone then
self.moveVector = Vector3.new(inputObject.Position.X, 0, -inputObject.Position.Y)
else
self.moveVector = ZERO_VECTOR3
end

and Replace it with the following:

if inputObject.Position.magnitude > thumbstickDeadzone then

		local x,z = inputObject.Position.X,-inputObject.Position.Y
		
		if x < -0.1 then x = -1 elseif x > 0.1 then x = 1 else x = 0 end
		
		if z < -0.1 then z = -1 elseif z > 0.1 then z = 1 else z = 0 end
		self.moveVector  =  Vector3.new(x, 0, z)
	else
		self.moveVector = ZERO_VECTOR3
	end

And now, it should be fixed! No more walking/running at slower rates from mobile/console users!

5 Likes

I appreciate this man it just helped me so much!

Still works. Just need to capitalise “unit”, much appreciated!

2 Likes

what do you mean “capitalise unit”??

KinqAndi Has updated it to capitalise it so it’s just good to go as is now :blush:

1 Like

The console solution works but is a bit clunky.

I instead recommend replacing the default

self.moveVector  =  Vector3.new(inputObject.Position.X, 0, -inputObject.Position.Y)

with

self.moveVector = Vector3.new(inputObject.Position.X, 0, -inputObject.Position.Y).Unit

sorry for bumping