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

MoveDirection doesn't work for Players?

From the wiki: **The following example would cause 'Player1' (in Workspace) to walk forward, towards where their camera is pointing, wait five seconds, and then stop the player. **

 Workspace.Player1.Humanoid:Move(Vector3.new(0, 1, 0), true)
wait(5)
Workspace.Player1.Humanoid:Move(Vector3.new(0, 0, 0), true)

Problem: It works for NPCS but it doesn't work for** players. ** Any solutions?

3 comments

0

Isn't it MoveTo()? Also, I think using Workspace fails. I think it has to be lowercase workspace or game.Workspace. On the workspace I might be wrong. Anyways, what was the error?

0

MoveTo() moves the player to a specific point whereas Move() makes the player move retentively to where their camera is pointing. Also, changing Workspace to workspace doesn't have an effect on the script.

0

Ah ha, I'm wrong. Awesome.

1 answer

This is untested but it may work, I don't know if you're supposed to loop set this property or if its set until you disable it yourself but you could set the property WalkToPoint to wherever you're attempting to reach. Otherwise you can try the pathfinding tutorial they have on the wiki and apply that to a character.

1 comment

0

using the walk to point method would be very inefficient for making a custom control script plus the wiki says that the move method (either on the local player or on the humanoid) should work which apparently it doesn't work for players even if the movement mode is set to scriptable

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