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

How do I make a brick move?

How'd I make a brick move. I know I have to use X, Y and stuff. I just need help Example: Brick moves forward 5 times every 1.3 seconds. Turns left 6 times every 1.3 seconds. So forth and so on. Help?

2 answers

Vector3's are simple once you get the hang of them...

As you mentioned above, you know the X, Y, & Z coordinates. I'm going to take your word on that...

Now, say you have a part that's at the coordinates, (0,0,0). But you want to move the part up & down, repeatedly...

Your code would look something like this:

local Part = script.Parent -- Assuming that the script is inside of the part.

while true do
Part.Position = Vector3.new(0,0,0) -- Starting Point.
wait(1.3)
Part.Position = Vector3.new(0,1,0)
wait(1.3)
Part.Position = Vector3.new(0,2,0)
wait(1.3)
Part.Position = Vector3.new(0,3,0)
wait(1.3)
Part.Position = Vector3.new(0,4,0)
wait(1.3)
Part.Position = Vector3.new(0,5,0) -- Ending Point
wait(1.3)
Part.Position = Vector3.new(0,4,0)
wait(1.3)
Part.Position = Vector3.new(0,3,0)
wait(1.3)
Part.Position = Vector3.new(0,2,0)
wait(1.3)
Part.Position = Vector3.new(0,1,0)
wait(1.3) -- Wait 1.3, then go back to the starting point.
end

I hope I helped!

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