Door refuses to open on a tweened hinge

So i have a weld constraint connecting a door to a hinge, and on a proximity prompt, opens the door. heres the problem: the door isnt opening. i verified the hinge moves, and just setting the orientation does indeed open the door, so i dont know what the problem is?

the door is not anchored

when i manually open the door, and then activate the prompt, the door just teleports back to being closed?

image
image
the black part is the hinge, and usually is transparency 1, it is at 0 to show the hinge

What is the model primary part? How you do handle the moving?

the model has no primary part. the door is a union, heres the script that handles the door opening

the hinge indeed tweens, but the door doesnt follow the tween

while true do
	script.Parent.Triggered:Connect(function()
		game:GetService("TweenService"):Create(script.Parent.Parent.Parent.DoorHinge, TweenInfo.new(0.5), {Orientation = Vector3.new(0, -105, 0)}):Play()
	end)
	task.wait()
end

Why are you using a loop for a function?

only way i know how to, plus it needs to be able to be reactivated

its a locker thing, and i plan on putting this in a the rooms remake or something

still gotta make animations, and im just trying to get the door to open and close
ill handle the closing part when the hinge problem is fixed

You are causing performance issues by constantly connecting to the same event. Once you connect to an event, the function will run for as many times as the event fires until you disconnect the connection.

and how do i disconnect the connection?

You don’t need to disconnect it if you wish for the ProximityPrompt to be triggered multiple times.

If you want it to reactivate, just use booleans. As for tweening, you need to use CFrame to tween parts with welds.

ok

char limit

i also dont know how to migrate it to cframe

ill probably make it so it has seats and stuff and walking into it is all you need to do

local part = script.Parent.Parent -- Door
local pos = part.Position + Vector3.new(0,50,0) -- Your position
local rot = part.CFrame - part.CFrame.Position
script.Parent.TriggerEnded:Connect(function()
	game:GetService("TweenService"):Create(script.Parent.Parent, TweenInfo.new(1), {CFrame = CFrame.new(pos) * rot}):Play()
end)

Your position, make sure the door is unanchored while the hinge is anchored.

this just moves the door, doesnt affect the orientation

Do CFrame = CFrame.Angles(0, math.rad(-105),0) instead of this.

Oh you wanted orientation, my bad, you can use CFrame.Angles

image

what i put in:

local part = script.Parent.Parent -- Door
local pos = part.Position + Vector3.new(0,50,0) -- Your position
local rot = part.CFrame - part.CFrame.Position
script.Parent.TriggerEnded:Connect(function()
	game:GetService("TweenService"):Create(script.Parent.Parent, TweenInfo.new(1), {CFrame = CFrame.Angles(pos) * rot}):Play()
end)