Hello! I have a question! Soooo i'm using prismaticconstraints to build a train door system And the doors values will all update, but the doors wont move. Basically, the doors wont move unless the position is updated. What should I do!
Here is the code in question:
local DoorTargetPositionRef = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent:WaitForChild("SystemValues"):WaitForChild("LDoorTargetPosition")
local DoorTargetPosition = DoorTargetPositionRef.Value
script.Parent.TargetPosition = DoorTargetPosition
DoorTargetPositionRef.Changed:Connect(function()
DoorTargetPosition = DoorTargetPositionRef.Value
local model = script.Parent.Parent.Parent
if model:WaitForChild("One").CanCollide == true or model:WaitForChild("Brush").CanCollide == true or model:WaitForChild("Window").CanCollide == true then
model:WaitForChild("One").CanCollide = false
model:WaitForChild("Brush").CanCollide = false
model:WaitForChild("Window").CanCollide = false
script.Parent.TargetPosition = DoorTargetPosition
else
model:WaitForChild("One").CanCollide = false
model:WaitForChild("Brush").CanCollide = false
model:WaitForChild("Window").CanCollide = false
script.Parent.TargetPosition = DoorTargetPosition
repeat wait() until script.Parent.CurrentPosition == DoorTargetPosition
model:WaitForChild("One").CanCollide = true
model:WaitForChild("Brush").CanCollide = true
model:WaitForChild("Window").CanCollide = true
end
end)
Any help would be appreciated!
