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

Cframe a model? Moving a model set pieces.

Asked by 7 years ago

Hello,

So I would like to know how the best way to make a moving model cframe would be? I am working on a game and need the curtain, which is a model with many parts composed of the curtain to move up. I don't want it to look blocky but be a smooth cframe. Also, how would I change the direction it moves? Thanks, Anthony

1 answer

Log in to vote
1
Answered by
xEmmalyx 285 Moderation Voter
7 years ago
Edited 7 years ago

Let's say your model Curtain is in workspace to move it up you would multiply it's CFrame by a new CFrame and set it's PrimaryPart Make sure you click the model and set the primary part or use a script to set it like this

workspace.Curtain.PrimaryPart = workspace.Curtain.INSERT PART NAME HERE
workspace.Curtain:SetPrimaryPartCFrame(workspace.Curtain.PrimaryPart.CFrame * CFrame.new(0,5,0))

now to make it smooth and repeat you'd do this

for i = 1,100 do -- Replace 100 with an increment of times
workspace.Curtain:SetPrimaryPartCFrame(workspace.Curtain.PrimaryPart.CFrame * CFrame.new(0,0.1,0)) -- Replace 0.1 with how much you want it to move up
wait(.01) -- replace the wait timer with an acceptable amount of time to make it seem smooth and quick
end

Edit - Edited to work for models

Ad

Answer this question