Click To Move Help

I have never touched the Click To Move feature however I was wondering if there was anyway I could possibly edit the already built in Click To Move feature? It’s kinda clumpy and works very few times, wanted to try to tweak it and fix most of it however any suggestions is appreciated!

(Do not want to make my own tbh)

1 Like
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local mouse = player:GetMouse()

mouse.Button1Down:Connect(function()
	character:PivotTo(mouse.Hit)
end)

Local script inside StarterCharacterScripts.

2 Likes

Unfortunately, you can’t edit core functions. But you can script your own version of it!

To disable the core feature change the following properties of StarterPlayer (you can do that in Studio):
StarterPlayer.DevComputerMovementMode to Enum.DevComputerMovementMode.KeyboardMouse
StarterPlayer.DevTouchMovementMode to Enum.DevTouchMovementMode.Thumbstick

Then you can recode it utilitzing Character Pathfinding and Mouse.Hit.Position.

Good luck!

1 Like

If you open up your game and click “Run,” a ModuleScript named “PlayerModule” will show up in StarterPlayer.StarterPlayerScripts. This contains all of ROBLOX’s default control scripts. If you copy this module, click “Stop,” and paste the module back into StarterPlayer.StarterPlayerScripts, ROBLOX will use that copy of the PlayerModule instead of spawning in a new one. This allows you to “fork” the default scripts.

The click-to-move controller is PlayerModule.ControlModule.ClickToMoveController. Make whatever changes you’d like to that script.

Bear in mind that because ROBLOX will be using your controller instead of spawning in the defaults, the scripts will never get updated, so if there is ever any meaningful update to the default controllers, you may need to port them over. That said, this isn’t a frequent occurrence, and the benefit of customized controllers generally outweighs that cost.

3 Likes