Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I implement rotation into this script, making the object rotate with the CFrame?

Hello, I'm currently making a door, based off a old script of when you interact, it rotates (to a 0, -90, 0 position).

for i = 0, 1, SPEED do for _, door in next, Door:GetChildren() do originalDoorCFrame[door] = originalDoorCFrame[door] == nil and door.CFrame or originalDoorCFrame[door] if door:IsA("BasePart") then door.CFrame = originalDoorCFrame[door]:Lerp(originalDoorCFrame[door] + originalDoorCFrame[door].LookVector * (DISTANCE*factor), i) end end wait() end

Any help is appreciated!

1 comment

0

Is the door a model or a part?

1 answer

Alright your making it too complicated so I'm going to just make a whole new script for you since I'm not at that level yet. Jesus Though anyways:

Door = script.Parent

Door.Cframe = Door.CFrame * CFrame.fromEulerAnglesXYZ(0,0,0) --Whatever you'd like

This discussion is preserved as it was. New answers, comments, and votes are closed.