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).
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))
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.
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:
-- (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)
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.