Tween Still Adjusting Orientation

Hey there!

I am currently trying to make a door open using CFrame, and in previous scripts the code seems to be working just fine, but for some reason this 1 door has decided to ignore the code and adjust its orientation completely.

Here is the code:

local ProximityPrompt = script.Parent
local team = game:GetService("Teams")
local Open = script.Parent.Parent.Parent.Parent.Door.sound.open
local Close = script.Parent.Parent.Parent.Parent.Door.sound.close
local Denied = script.Parent.Parent.Parent.Parent.Door.sound.denied

local Door1 = script.Parent.Parent.Parent.Parent.Door.RightDoor
local Door2 = script.Parent.Parent.Parent.Parent.Door.LeftDoor -- This is the door that is adjusting its orientation

local Door1Open = script.Parent.Parent.Parent.Parent.RightdoorOpen
local Door1Origin = Door1.CFrame
local Door2Open = script.Parent.Parent.Parent.Parent.LeftdoorOpen
local Door2Origin = Door2.CFrame

local TweenService = game:GetService("TweenService")

local tweeningInfo = TweenInfo.new(
	5,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.InOut,
	0,
	false,
	0

)

local tweenOpen1 = {CFrame = Door1Open.CFrame} -- Right Door
local tweenClose1 = {CFrame = Door1Origin} -- Right Door
local tweenOpen2 = {CFrame = Door2Open.CFrame} -- Left Door
local tweenClose2 = {CFrame = Door2Origin} -- Left Door


local OpenTween1 = TweenService:Create(Door1, tweeningInfo, tweenOpen1)
local CloseTween1 = TweenService:Create(Door1, tweeningInfo, tweenClose1)
local OpenTween2 = TweenService:Create(Door2, tweeningInfo, tweenOpen2)
local CloseTween2 = TweenService:Create(Door2, tweeningInfo, tweenClose2)


-- This is not the full script, the rest is just a trigger event for the proximity prompt and tween play

(Sorry if this is very simple and if the code is messy lol)

Thanks for the help! :grin:

Can you provide a video or an image on how your door works currently?

1 Like

Hello!

For the time being, the devforum doesn’t seem to be allowing me to upload. I will either try again in a few hours or tomorrow.

But a brief explanation.

So basically the left door orientation is 0, -90, 0. When the tween plays, the orientation will reset to 0, 0, 0.

I hope that cleared some things up!

1 Like