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

how do i walk to coordinates?

hi how do you make your character walk to coordinates

2 answers

If you want to make your own character walk to a certain position, first try to place a part in the position you want your character to arrive at.

Then, put a local script inside the StarterCharacterScript in Starter Player. You can copy this script if you like.

local humanoid = script.Parent:FindFirstChild("Humanoid")

local destination = game.Workspace.Part --This is used to determine the destination, I use a part as an example

--Now you want to use a :MoveTo method from your humanoid to make it move
wait(3) --This waits a bit before it moves because the character has to load first
humanoid:MoveTo(destination.Position)

If you don't want any inputs from the player while it is moving, you should disable character inputs first, as any input from the player will stop the script.

MoveTo is a function of the humanoid.

This function causes the Humanoid to attempt to walk to the given location by setting the Humanoid.WalkToPoint and Humanoid.WalkToPart properties.

I haven't used it much (ahem, at all) however here's an idea of how it works:

humanoid:MoveTo(Vector3.new(10,humanoid.Position.Y,10))

1 comment

0

you have to construct a new Vector3. you cant expect the interpreter to know what your numbers are supposed to represent

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