My code has been fully functional and works if the part is only one part, but when it’s a union, the proximity prompt won’t show on the other side. So the code opens and closes the door, and when I go to the other side and close it, it’s gone. But If I maneuver my camera through the glass on the other side, it’ll show again. Do I just need to remove the union and try to weld all the parts correctly, or is there an easier way to do this in the script?
Here’s the code for reference:
local tweenService = game:GetService("TweenService")
local door = script.Parent.Door
local hinge = script.Parent.Hinge
local prompt = script.Parent.Door.ProximityPrompt
local goalOpen = {}
goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90),0)
local goalClose = {}
goalClose.CFrame = hinge.CFrame * CFrame.Angles(0,0,0)
local tweenInfo = TweenInfo.new(1)
local tweenOpen = tweenService:Create(hinge, tweenInfo, goalOpen)
local tweenClose = tweenService:Create(hinge,tweenInfo, goalClose)
prompt.Triggered:Connect(function()
if prompt.ActionText == "Close" then
tweenClose:Play()
prompt.ActionText = "Open"
else
tweenOpen:Play()
prompt.ActionText = "Close"
end
end)