How to make a multidirectional tween

Hello! So recently I learned how to use TweenService, and its very useful. I used it to make some automatic doors, but the one problem is this. I rotated the door because I needed to have a door that was sideways. But when I tested the game, The door went up while spinning. When it went down it stayed turned. Here’s a video. robloxapp-20201230-1808279.wmv (1.4 MB)

Here it is
local door = script.Parent.Door
local TweenStyle = TweenInfo.new(5, Enum.EasingStyle.Cubic,Enum.EasingDirection.Out,0,false,0)
local open = {CFrame = CFrame.new(-50.325, 50.777, 0.991)}
local close = {CFrame = CFrame.new(-50.325, 39.207, 0.991)}
local opentween = game:GetService(“TweenService”):Create(door,TweenStyle,open)
local closetween = game:GetService(“TweenService”):Create(door,TweenStyle,close)
door.ClickDetector.MouseClick:Connect(function()
opentween:Play()
wait(5)
closetween:Play()
end)

Maybe this video will help you: How to: Make An Animated Door In Roblox Studio (Still works november 2020) - YouTube

It works perfectly fine for all the other doors, I just cant rotate them.robloxapp-20201230-1808124.wmv (1.3 MB)

The issue is with the open and close dictionaries. That particular use of CFrame.new defines the position, not rotation. Since the subject are parts, you can just use the orientation properties. So:

local open = {Orientation = Vector3.new(0, 90, 0)}

(do the same for close)
Just change the 90 do any degree value of your choosing.

1 Like

Okay! Something just clicked inside my brain and I think I understand now! Thank you!