Player wont move

I am trying to force player movement to a certain location. The script only works if the numbers are:

(0, 0, -1)

Here is the script:

game.Players.LocalPlayer:Move(Vector3.new(3.5, 0.5, -47.5), true) --run in a local script in startercharacterscripts

Is the Player’s WalkSpeed set to 0? It might also be because you’re moving the Player relative to where the camera is pointing at rn

1 Like

The walkspeed is set to 16. How would I not make it relative to where the camera is?

I guess setting the second parameter of that Move function to false?

Anyways, could you try maybe waiting for the player to load instead? Or add a wait() to see if there’s any difference?

1 Like

Adding the wait() made the player move for a millisecond, a wait(3).
local function onCharacterAdded(character) didn’t seem to work either, neither did setting it to false or true.

try this instead

local Destination = Vector3.new(3.5, 0.5, -47.5)




local Humanoid = script.Parent:WaitForChild("Humanoid")
local PlayerControls = require(game:GetService("Players").LocalPlayer.PlayerScripts.PlayerModule):GetControls()


PlayerControls:Disable()


local function moveTo(humanoid, targetPoint, andThen)
	local targetReached = false

	-- listen for the humanoid reaching its target
	local connection
	connection = humanoid.MoveToFinished:Connect(function(reached)
		targetReached = true
		connection:Disconnect()
		connection = nil
		if andThen then
			andThen()
		end
	end)

	-- start walking
	humanoid:MoveTo(targetPoint)

	-- execute on a new thread so as to not yield function
	spawn(function()
		while not targetReached do
			-- does the humanoid still exist?
			if not (humanoid and humanoid.Parent) then
				break
			end
			-- has the target changed?
			if humanoid.WalkToPoint ~= targetPoint then
				break
			end
			-- refresh the timeout
			humanoid:MoveTo(targetPoint)
			wait(6)
		end

		-- disconnect the connection if it is still connected
		if connection then
			connection:Disconnect()
			connection = nil
		end
	end)
end


moveTo(Humanoid, Destination, function()
	PlayerControls:Enable()
	script:Destroy()
end)

Humanoid.WalkToPoint (roblox.com)

dude game.Players.LocalPlayer doesn’t do anything.
You have to get their Character then their Humanoid
game.Players.LocalPlayer.Character.Humanoid:Move(Vector3.new(3.5, 0.5, -47.5))
Hope this helps :slight_smile:

what are you talking about?

1 Like

Where do I put the xyz? In the (humanoid(x), targetPoint(y), andThen(z)) ?

In the destination variable at the top

1 Like

oopsie i think i mistook it for npc moving owo

1 Like

I think it is moving toward the place the camera is pointing

The following example would cause the LocalPlayer to walk forward, towards where their camera is pointing. game.Players.LocalPlayer:Move(Vector3.new(0, 0, -1), true)