I have made a sliding door for my game, but when it opens it somehow changes the orientation of door from 0,90,0 to 0,0,0 instead of just sliding. I am still a starter so i have no idea what to do. code:
local TweenService = game:GetService("TweenService")
local door1 = script.Parent:WaitForChild("Door1")
local door2 = script.Parent:WaitforChild("Door2")
local tweeningInformation = TweenInfo.new(1.2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local door1Open = {Cframe = Cframe.new(Postion)}
local door2Open = {Cframe = Cframe.new(Position)}
local door1Close = {Cframe = Cframe.new(Position)}
local door2Close = {Cframe = Cframe.new(position)}
local tween1open = TweenService:Create(door1,tweeningInformation,door1Open)
local tween1close = TweenService:Create(door1,tweeningInformation,door1Close)
local tween2open = TweenService:Create(door2,tweeningInformation,door2Open)
local tween2close = Tweenservice:Create(door2,tweeningInformation,door2Close)
script.Parent.Detector1.Touched:Connect(function(hit)
tween1open:Play()
tween2open:Play()
wait(3)
tween1close:Play()
tween2close:Play()
end)
script.Parent.Detector2.Touched:Connect(function(hit)
tween1open:Play()
tween2open:Play()
wait(3)
tween1close:Play()
tween2close:Play()
end)

1 comment
Thanks for explanation. However, i think i still dont understand it so if it`s not inconvinient, will you show me the where i should put that bit of code? Thank you :D