My WeldConstraint isnt working

I have already messed with the Weld Constraints and made them work but now these are not. I wanted the yellow lists to follow the gate but instead they just stand still.
And Yes, the yellow blocks are not anchored and the gate is anchored.

Images:
image
image

Script:
Script doesn’t mess with the Welds so it would be useless but in case someone needs it here it is.

local Prompt = script.Parent
local Reader = script.Parent.Parent.Parent.CardReader
local Door = script.Parent.Parent.Parent.Door
local TemplDoor = script.Parent.Parent.Parent.TemplDoor
local Bool = script.Parent.Parent.Parent.Working
local Red = Reader.Red
local Green = Reader.Green
local SoundRefuse = Reader.Refused
local SoundAccepted = Reader.Accepted
local SoundOpening = Door.Opening
local TX = TemplDoor.Position.X
local TY = TemplDoor.Position.Y
local TZ = TemplDoor.Position.Z
local DX = Door.Position.X
local DY = Door.Position.Y
local DZ = Door.Position.Z
local clearence = {   
	"[BDK] Level-2", 
	"[BDK] Level-3",
	"[GDI] Level -2",
	"[NC] Level-3",
	"[NC] Level-4",
	"[NC] Level-5",
	"[NC] Level-C",
	"[NC] Level-X",
}
local PH = {
	"[NC] Level-0", 
	"[NC] Level-1",  
	"[NC] Level-2", 
}
local TweeningInfo = TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local GateOpen = { Position = Vector3.new(TX, TY, TZ)}
local GateClose = { Position = Vector3.new(DX, DY,DZ)}
local Open = game:GetService("TweenService"):Create(Door, TweeningInfo, GateOpen )
local Close = game:GetService("TweenService"):Create(Door,TweeningInfo, GateClose )
Prompt.Triggered:Connect(function(Player)
	if Bool.Value == false then
		for _, item in pairs(Player.Backpack:GetDescendants()) do
			if table.find(clearence, item.Name) then
				Bool.Value = true
				SoundAccepted:Play()
				Open:Play()
				SoundOpening:Play()
				Green.Material = Enum.Material.Neon
				wait(10) 
				Close:Play()
				SoundOpening:Play()
				Green.Material = Enum.Material.Ice
				wait(5)
				Bool.Value = false
				return
			elseif table.find(PH, item.Name) then
				SoundRefuse:Play()
				Red.Material = Enum.Material.Neon
				wait(0.5)
				Red.Material = Enum.Material.Ice
				return
			end
		end
	end
end)

Make sure C0 and C1 are properly assigned to the parts.

1 Like

image
image

Indeed, they are.

Changed the Vector to CFrame and resolved the Problem.

Old:

local GateOpen = { Position = Vector3.new(TX, TY, TZ)}
local GateClose = { Position = Vector3.new(DX, DY,DZ)}
local Open = game:GetService("TweenService"):Create(Door, TweeningInfo, GateOpen )
local Close = game:GetService("TweenService"):Create(Door,TweeningInfo, GateClose )

Now:

local GateOpen = {}
GateOpen.CFrame = CFrame.new(TX, TY, TZ)
local GateClose = {}
GateClose.CFrame = CFrame.new(DX, DY,DZ)
local Open = game:GetService("TweenService"):Create(Door, TweeningInfo, GateOpen )
local Close = game:GetService("TweenService"):Create(Door,TweeningInfo, GateClose )```

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