Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by
RookPvPz -27
14 days ago

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!

0
Is the door a model or a part? flunkywhat 20 — 14d

1 answer

Log in to vote
0
Answered by
Markdrg 15
14 days ago

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
Ad

Answer this question