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

Can You "Tween" Objects?

Asked by 10 years ago

All right, I know that you can use the :Tweening() method for GUIs, to create a fluid movement with little coding, but is there a way to do this with objects, such as bricks? Essentially, I want to create a door that opens as a hinged door would when you push a button. Is there any method to doing this, other than setting the position several times?

1 answer

Log in to vote
0
Answered by 10 years ago

Subtract/add the position by a set number repeatedly, so:

Part = workspace.Part
move = CFrame.new(1,0,0)
repeat
Part.CFrame = CFrame*move
wait(.5)
until Part.Position = Vector3.new(5,0,0)

Something like that.

Ad

Answer this question