Player:Move() not working

Hi,
I want to move the player through a localScript. I have found the function Player:Move(), but when I use it, nothing happens. I put the following code in a Localscript under StarterPlayerScripts. (this is the code sample that is written in the documentation of this function).

game.Players.LocalPlayer:Move(Vector3.new(-1, 0, 0), true)

I also found the function Humanoid:Move(), but that also doesn’t work. What am I doing wrong?

You don’t move the player, you move the character’s Humanoid so your code should look like this

local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

Humanoid:Move(Vector3.new(-1, 0, 0))

Player:Move() actually does exist. I THINK you can only do this on a server script. Use a remote event

turns out, it is a real thing, however when I tried this script out, it gave me a warning saying “Player:Move called, but player currently has no character”. So you’ll have to wait until the Character is loaded in order for it to work.

This should work

local Player = game:GetService("Players").LocalPlayer

Player.CharacterAdded:Wait()

task.wait()

Player:Move(Vector3.new(0, 0, -1), true)

I tried both humanoid:Move() and player:Move(), but neither works. Both on the server and on the client. When I do it on the server does turn for a fraction of a second, as if it starts to walk but immediately stops again. LocalScript:

game.Players.LocalPlayer.CharacterAdded:Wait()
task.wait(1)
print("Should walk now")
game.Players.LocalPlayer:Move(Vector3.new(-1, 0, 0), true)
task.wait(1)
print("Moving Humanoid")
game.Players.LocalPlayer.Character.Humanoid:Move(Vector3.new(-1, 0, 0), true)

ServerScript:

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Wait()
	task.wait(1)
	print("Moving player")
	player:Move(Vector3.new(1, 0, 0), false)
	
	task.wait(1)
	player.Character.Humanoid:Move(Vector3.new(-1, 0, 0), false)
	print("Moving Humanoid")
end)

Nothing of this makes the character move. I even tried disabling movement input, but that also doesn’t have any effect

It is Humanoid:MoveTo, not Humanoid:Move

1 Like

When you say you want the player to move, do you mean like walk towards the destination?

If you are then this should work

also like @Colountt said, it’s :MoveTo() not Move

-- (Local Script, StarterCharacterScripts)

local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

repeat task.wait() until game:IsLoaded()

wait(2)

Humanoid:MoveTo(Vector3.new(10,0,10)) -- MoveTo doesn't need a true/false parameter
-- this is wrong Humanoid:MoveTo(Vector3.new(10,0,10), true)

Yes i did say its :MoveTo(), But pls make this the solved answer since im the first person that solved it.

I don’t want the player to walk to a certain destination, I just want the player to walk forward. I can constantly call MoveTo() to a position in front of the player, but that seems weird as there should be two functions that just let the player move in a certain direction. If Player:Move() en Humanoid:Move() are both somehow broken, then there should probably be a bug report (which I can’t do as I don’t have permission). If the conclusion comes that the two functions are broken, I’ll just think of another solution.

Okay, Here is your script

game.Players.LocalPlayer:MoveTo(Vector3.new(-1, 0, 0), true)

Thank you! Sorry for not understanding you earlier. I thought MoveTo() was just for moving to a specific position.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.