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

How Can I Make This MoveTo Work?

Asked by 8 years ago

Hello, I am very novice right now, so please try to understand. I am trying to move a part with MoveTo, why will it now work? Here is the code:

wait(3)
game.Workspace.Part:MoveTo( Vector3.new(10,10,10) )

Thanks!

1 answer

Log in to vote
0
Answered by 8 years ago

Always check the roblox wiki as it is very helpful, and to answer your question you can use either of the following, MoveTo is used to "teleport" characters/players as it get's their current character property and moves it to the given location.

wait(3)
game.Workspace.Part.Position = Vector3.new(10,10,10)
 -- this sets the position of the part to the location/coordinates in the workspace BUT, will collide with other bricks if attempted to be put inside a brick
game.Workspace.Part.CFrame = CFrame.new(10,10,10)
-- this also sets the posotion of the part to the location/coordinates in the workspace AND, moves the part through other parts

Also, more information: http://wiki.roblox.com/index.php?title=API:CoordinateFrame

0
Oh ok then! So that means MoveTo is a type of command? yoman1776 85 — 8y
Ad

Answer this question