Proximity Prompt won't show on other side of Union Part

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)

Make sure that you have nothing obstructing it. If there is, you might want to uncheck the “RequiresLineOfSight” property if you have not done so already.

image

1 Like

THANK YOU, I didn’t realize it was something this simple :smiling_face_with_tear:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.