The left hand side of the door opens correctly. The other side decides to open the incorrect way. I have looked on the Devforum for similar issues and I haven’t found one that is related to the same issue I’m having. I have tried modifying the angles & easing direction however that didn’t change anything.
Code:
local Hinge = script.Parent.PrimaryPart
local opened = false
local TS = game:GetService("TweenService")
local teams = {game.Teams["Host Team"], game.Teams.Supervisor}
function OpenDoor()
if opened == false then
opened = true
local tween = TS:Create(script.Parent.Door1.Primary, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Orientation = Vector3.new(0, 180, 90)})
tween:Play()
local tween2 = TS:Create(script.Parent.Door2.Primary, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {Orientation = Vector3.new(0, 180, 90)})
tween2:Play()
else
opened = false
local tween = TS:Create(script.Parent.Door1.Primary, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Orientation = Vector3.new(0, 90, 90)})
tween:Play()
local tween2 = TS:Create(script.Parent.Door2.Primary, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.In), {Orientation = Vector3.new(0, -90, 90)})
tween2:Play()
end
end
script.Parent.ClickPart.ClickDetector.MouseClick:Connect(function(Player)
if table.find(teams, Player.Team) then
OpenDoor()
end
end)```
You may have a sign issue. In your code, you open both doors by changing the orientation to 0, 180, 90 for both doors. In the closing algorithm, you change the orientation to 0, 90, 90 for Door 1 and 0, -90, 90 for Door 2. Notice how the y-axis for only a single door is positive when you close it, but the y-axis for both doors is positive when you open it. Try to change one of the the numbers to negative when you open the door.
It’s more than likely the orientation that need to be changed when you open the door, they’re on opposite sides so changing their orientation with the exact same value should be the problem.