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

How do you make a script to move an object/model Cframe?

Asked by 7 years ago

I have found scripts local scripts to move/ rotate a object/model, but I do not know how to make the script work. Can anyone help?

1 answer

Log in to vote
1
Answered by 7 years ago

I don't think local scripts should do the job for you. A normal script should be fine.

Here, this should help you.

local part = script.Parent

local start = part.CFrame * CFrame.new(0,0,0)
local finish = part.CFrame * CFrame.new(0,2,0) -- only edit these numbers
--if you want it to rotate instead of move, change "CFrame.new" to "CFrame.Angles"

-- over the course of 1 second, vary `progress` from `0` to `1`
for progress = 0, 1, 0.03 do --If you want it to loop, change the number one here to 2. Also add "while true do" before "for progress".  
    part.CFrame = start:lerp(finish, progress) --this makes the part move from the start to finish
    wait()
end

0
He said model. OldPalHappy 1477 — 7y
0
yeah i know, he could try welding all the parts together but I don't even know how to do that flufffybuns 89 — 7y
Ad

Answer this question