Is there a way to keep a part's orientation static during a tween?

My issue is that whenever I tween a part (or anything for that matter), it’s orientation smoothly glides to 0, 0, 0, as shown below:

You can see in the properties of the part that the orientation is changing. How do I make sure it does not change when the part is tweened?

show code.

Explorer:
image
Code:

No errors in output.

copy and paste it. No screen shots. Those dont help.

------------------------------------------------------------------------ Variables

local TweenService = game:GetService("TweenService")

local door1 = script.Parent

local tweeningInformation = TweenInfo.new(
5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
------------------------------------------------------------------------ Destinations
local door1Open = {CFrame = CFrame.new(59, 23.167, -97)}
local door1Close = {CFrame = CFrame.new(59, 23.167, -211.6)}
------------------------------------------------------------------------ TweenOpens/Closes
local tween1open = TweenService:Create(door1,tweeningInformation,door1Open)
local tween1close = TweenService:Create(door1,tweeningInformation,door1Close)
------------------------------------------------------------------------ Execution
wait(2)
tween1open:Play()
wait(0.1)
tween1close:Play()

simple fix

------------------------------------------------------------------------ Variables

local TweenService = game:GetService("TweenService")

local door1 = script.Parent

local tweeningInformation = TweenInfo.new(
	5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)
------------------------------------------------------------------------ Destinations
local door1Open = {CFrame = CFrame.new(59, 23.167, -97) * door1.CFrame.Rotation}
local door1Close = {CFrame = CFrame.new(59, 23.167, -211.6) * door1.CFrame.Rotation}
------------------------------------------------------------------------ TweenOpens/Closes
local tween1open = TweenService:Create(door1,tweeningInformation,door1Open)
local tween1close = TweenService:Create(door1,tweeningInformation,door1Close)
------------------------------------------------------------------------ Execution
wait(2)
tween1open:Play()
wait(0.1)
tween1close:Play()

1 Like