Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can one use MoveTo() w/Humanoid and not be interrupted by the player's controls?

Eh... I am pretty sure this can be done. If not then I am doomed.

I have tried WalkToPoint() which essentially does the same thing as MoveTo() with a humanoid.

So I have tried using both, and they can both be interefered with the player's controls. WASD or Arrow Keys

I also have tried putting the player's WalkSpeed at 0 or a low level, but that disables the player to even walk at all.

Also here is what I have so far:

local debounce = true
local WalkTo = script.Parent.Parent.TriggerStop

script.Parent.Touched:Connect(function(plr)
	if plr.Parent:FindFirstChild("Humanoid") then
		if not debounce then
			return
		end
		debounce = false
		plr.Parent.Humanoid.WalkSpeed = 16
		plr.Parent.Humanoid:MoveTo(WalkTo.Position)
		wait(0.01)
		debounce = true
	end
end)

Any feedback is helpful!

7 comments

0

One thing you could try is figure out how to temporarily "disable" the WASD keys so they can't interfere in your MoveTo() script. I'm not quite sure how you would achieve this but it's a start.

0

Good question, btw, don't use moveto, use CFrame on HRP (humanoidrootpart) instead

0

I don't think it still works though, but you can try

0

Okay I can probably try to use the disable controls, but wont CFrame just "teleport" me to the destination? I would like to see the walking

0

Please see https://wiki.roblox.com/index.php?title=API:Enum/DevComputerMovementMode and https://wiki.roblox.com/index.php?title=API:Enum/DevTouchMovementMode for altering how players' controls move the character. Scriptable will disable all default movement controls.

0

@IPsec yes this did disable the player's controls, It did not allow me to move my player to the required destination, much like setting the player's WalkSpeed and JumpPower to 0

1 answer

I have decided to use BodyVelocity because this would take me ages

If anybody happens to find the answer, contact me or write an answer..

This discussion is preserved as it was. New answers, comments, and votes are closed.