Mobile touch movements

Hello everyone,

So i have recently been working of one of my games and one of the problem I have recently encountered is that the touch controls on mobile interfere with the UI the player has to interact with. The UI is a SurfaceGui so it doesn’t go over the player controls, and the camera is being manipulated to be directly in front of the UI.

I have tried to change the player’s control from Dynamic Thumbstick to Touch To Move (While the player is focused on the UI the player speed is 0), But the player control does not seem to change and the Dynamic Thumbstick is still the same control while being focused on the UI.

Here is the code I use for camera manipulation and control change:

local player = game.Players.LocalPlayer
game.Workspace.RoomOne.CameraPart.ProximityPrompt.Triggered:Connect(function()
	wait(0.05)
	workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
	workspace.CurrentCamera.CFrame = workspace.RoomRoom.CameraPart.CFrame
	player.Character.Humanoid.WalkSpeed = 0
	player.Character.HumanoidRootPart.CFrame = workspace.RoomOne.RoomOneTeleportPart.CFrame
	game.Workspace.CurrentCamera.FieldOfView = script.Parent.PcOne.BackGround.TransparencyCreator.ChangeSets.BackGroundV2.Storage.ScrollingFrame.FovValue.Value
   

    (Player Movement Manipulation Part)game.StarterPlayer.DevTouchMovementMode = Enum.DevTouchMovementMode.ClickToMove
end)

Even when the player has triggered the above function the movement mode does not change, and interferes with the UI.

1 Like

You can get rid of it with this;

if game:GetService("UserInputService").IsTouchEnabled then
    game.Players.LocalPlayer.PlayerGui.TouchGui:Destroy()
    print("Got rid of the movement ui!")
end

But when the player unfocussed from the UI the player wont be able to move any longer right?

Yeah, they wont. You can also disable it if you sill want the movement later.

I have just decided to enable and disable the player controls, anyways thanks!