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

How do I make a brick move?

Asked by 10 years ago

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

Log in to vote
-3
Answered by 10 years ago

http://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=video&cd=2&cad=rja&uact=8&ved=0CDsQtwIwAQ&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DgCm-rYjomqs&ei=L8dFU7qlDIirsQTUwoGwAg&usg=AFQjCNG3BcIhUxCXh2cii4Q4tfaatBIKPQ&sig2=MooCcycWNs-atO0BnGgEfQ&bvm=bv.64507335,d.aWc

Ad
Log in to vote
-1
Answered by
sgsharp 265 Moderation Voter
10 years ago

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!

Answer this question