Proximity Prompt Door Help

You can write your topic however you want, but you need to answer these questions:

  1. I want to make a door that can open and close with a proximity prompt!

  2. With the script, I have added print statements, all of them print when required, but the tween is no playing

  3. I have watched a tutorial and looked on the Developer forum and nothing helped.

SCRIPT

print(1)
local TweenService = game:GetService("TweenService")

local hinge = script.Parent.DoorFrame.Hinge
local prompt = script.Parent.Base.ProximityPrompt
print(2)
local goalOpen = {}
goalOpen.CFrame = hinge.CFrame * CFrame.Angles(0, math.rad(90), 0)

local goalClose = {}
goalClose.CFrame = hinge.CFrame * CFrame.Angles(0, 0, 0)
print(3)
prompt.ActionText = "Open"

local tweenInfo = TweenInfo.new(1)
local tweenOpen = TweenService:Create(hinge, tweenInfo, goalOpen)
local tweenClose = TweenService:Create(hinge, tweenInfo, goalClose)
print(4)
prompt.Triggered:Connect(function()
	print(5)
	if prompt.ActionText == "Close" then
		tweenClose:Play()
		print(6)
		prompt.ActionText = "Open"
	else
		tweenOpen:Play()
		print(7)
		prompt.ActionText = "Close"
	end
end)

Screenshot 2022-04-11 115337

1 Like

What is the exact issue, could you elaborate a bit? Does the prompt not work? What errors are given to you?

The prompt works fine, so when the prompt is triggered, the prompt action text will change to open and viseversa, it is just the tween that is not working It doesn’t fire.

1 Like

Well,
I tested it with the base part itself [the main door part] and it worked, there’s possibly an issue with your Hinge ,because the rest of the code looks fine

Does anything need to be unanchored?

My parts were anchored, and worked fine, so I don’t think it has to do something with that.

Is the hinge your main part?

Also, since your tween doesnt play, there is apparently an issue with the tween[ maybe the tables you set], try to see if theres any error with the tables inside the tweens[print,warn ,etc] - debugging.

What do you mean by main part?