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

Brick floating up and down...?

Asked by 10 years ago

Hi, i am a beginner to scripting, know some of the basics and a little advance scripting (Not much) and i was trying to figure out how to make a Part float Up and down Continuously... I don't know how you would do this. Would you just use a script or BodyPosition or something? Or just change position with a script? I can't figure this out. I have searched google and nothing has come up.

I do NOT want the full script, Just how this is possible.

3 answers

Log in to vote
2
Answered by 10 years ago

To answer your question explicitly, yes, a BodyPosition object is what you would want to use. You can change the position from a high point to a low point on an interval, and modify the properties of the object so that it moves smoothly.

Ad
Log in to vote
0
Answered by
Andalf 100
10 years ago

You can use either a body position or set the CFrame of the part, you'll need a while loop to make it happen continuously.

while condition do --code stuff here. end

You can set the bodyPositions position to the parts position than after so much time add a new vector with a different y value, then make it drop again and the while loop will repeat it.

Or you can just set the CFrame of the part.

The first method is probably the better one in this case.

Log in to vote
-1
Answered by 10 years ago
while true do 
script.Parent.BodyVelocity.velocity = Vector3.new(0, 3, 0)
wait(3)
script.Parent.BodyVelocity.velocity = Vector3.new(0, -3, 0)
wait(3)
end

Answer this question