Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

how do i walk to coordinates? [closed]

Asked by 4 years ago

hi how do you make your character walk to coordinates

Closed as Not Constructive by BestCreativeBoy, LennyPlayzYT, and imKirda

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by
QWJKZXF 88
4 years ago

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.

Ad
Log in to vote
-1
Answered by
sngnn 274 Moderation Voter
4 years ago
Edited 3 years ago

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))
0
you have to construct a new Vector3. you cant expect the interpreter to know what your numbers are supposed to represent Gey4Jesus69 2705 — 4y