Hey, please can someone check this code?
you can skip these paragraphs but it just gives some context
Basically I'm trying to make two parts rotate at the same time but when I try to run this only the right part moves, I'm assuming this is because the function is only looking at the right part and not including the left part.
At some point I was able to make them both at least move but the left side literally spun around and popped into the same place as the right door where it basically did what the right part was doing (which I guess gave some hope) but I couldn't do anything because I didn't know why it happened.
This bit of code when ran shows only the right part moving
local TweenService = game:GetService("TweenService")
local frontdoor = script.Parent
local hingeL = script.Parent.frontdoors.HingeL
local hingeR = script.Parent.frontdoors.HingeR
local prompt = script.Parent.frontdoors.ProximityPrompt
--left
local goalOpen = {}
goalOpen.CFrame = hingeL.CFrame * CFrame.Angles(0, math.rad(90), 0)
local goalClose = {}
goalClose.CFrame = hingeL.CFrame * CFrame.Angles(0, 0, 0)
--right
local goalOpen = {}
goalOpen.CFrame = hingeR.CFrame * CFrame.Angles(0, math.rad(90), 0)
local goalClose = {}
goalClose.CFrame = hingeR.CFrame * CFrame.Angles(0, 0, 0)
--play
local tweenInfo = TweenInfo.new(1)
local tweenOpen = TweenService:Create(hingeL, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hingeL, tweenInfo, goalClose)
local tweenOpen = TweenService:Create(hingeR, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hingeR, tweenInfo, goalClose)
prompt.Triggered:Connect(function()
if prompt.ActionText == "Close" then
tweenClose:Play()
prompt.ActionText = "Open"
else
tweenOpen:Play()
prompt.ActionText = "Close"
end
end)
