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

MoveTo() Method Help

Asked by 10 years ago

I am not really comfortable using MoveTo() Method because I'm new to it. Here is like a snip-it of a MoveTo() Script(I NEED HELP UNDERSTANDING IT)

Workspace.Shedletsky.Humanoid:MoveTo(Vector3.new(0,0,0))

Or something other like this

Workspace.Shedletsky.Humanoid:MoveTo(Workspace.Part)

And another one

Workspace.Shedletsky:MoveTo(Vector3.new(0,0,0))

Help?

4 answers

Log in to vote
1
Answered by 10 years ago

Workspace.Shedletsky.Humanoid:MoveTo(Vector3.new(0,0,0)) The above line allows the character of "Shedletsky" to walk to the position, since the MoveTo method is used onto the Humanoid, not the character. The position is a Vector3 value.

Workspace.Shedletsky.Humanoid:MoveTo(Workspace.Part) This line is the same thing as the first, except that a Part is used as the argument instead of the Vector3 value. 'Shedletsky' will walk to the Part named.

Workspace.Shedletsky:MoveTo(Vector3.new(0,0,0)) This snip-it of code (above) looks similar to the first example but is different. Because you are using the MoveTo method to the character, not the Humanoid of that character, this line would teleport 'Shedletsky' to the position (which is a Vector3 value).

Ad
Log in to vote
1
Answered by
Trewier 146
10 years ago

The MoveTo() method is a fairly simple one.

Workspace.Shedletsky.Humanoid:MoveTo(Vector3.new(0,0,0)) Will make Shedletsky try to walk to the Vector3 position

As for this: Workspace.Shedletsky.Humanoid:MoveTo(Workspace.Part) Will make Shedletsky try to walk to the Part.

And another one

Workspace.Shedletsky:MoveTo(Vector3.new(0,0,0)) Moves the block to 0,0,0 unless there is a brick there, then the brick will move to the lowest position above the Vector3 position.

I hope this helped.

Log in to vote
0
Answered by
Vrakos 109
10 years ago

To make a humanoid, you must specify a position and a part.

Workspace.Shedletsky.Humanoid:MoveTo(Vector3.new(0,0,0),Workspace.Part)

It's basic. ;)

Log in to vote
-2
Answered by 10 years ago

Read this to learn about the MoveTo method: http://wiki.roblox.com/index.php/MoveTo_(Method)

BTW you can also use CFrame to move "Shedletsky":

game.Workspace.Shedletsky.Torso.CFrame = CFrame.new(0, 0, 0);

Answer this question