Recently, I’ve been working on an opening door. It uses a ProximityPrompt to open/close once you trigger the prompt, and it rotates the door 90 degrees using SetPrimaryPartCFrame
. All parts are unanchored and have weld constraints to the Hinge.
The issue is that only two parts aren’t moving with the rest of the door. Those parts are labeled as Problematic Part
in the model. I checked to make sure they were the same as the others, however I may be missing something.
Script: (most likely not the cause)
local Prompt = script.Parent
local Door = script.Parent.Parent.Parent
local Hinge = Door.PrimaryPart
local sound = game.Workspace.Door.Handle.Sound
local OpenCloseCooldown = .25
local Debounce = false
local function open()
for i = 1,18 do
Door:SetPrimaryPartCFrame(Hinge.CFrame * CFrame.Angles(0,math.rad(5),0))
wait()
end
Prompt.ActionText = "Close"
sound:Play()
end
local function close()
for i = 1,18 do
Door:SetPrimaryPartCFrame(Hinge.CFrame * CFrame.Angles(0,math.rad(-5),0))
wait()
end
Prompt.ActionText = "Open"
end
Prompt.Triggered:Connect(function()
if Prompt.ActionText == "Open" then
if not Debounce then
Debounce = true
open()
delay(OpenCloseCooldown,function()
Debounce = false
end)
end
elseif Prompt.ActionText == "Close" then
if not Debounce then
Debounce = true
close()
delay(OpenCloseCooldown,function()
Debounce = false
end)
end
end
end)
Model:
https://www.roblox.com/library/6336743241/Problematic-Door
The script is located in: Door > Handle > ProximityPrompt > Behaviour
Example of behaviour:
https://streamable.com/42kzon