-
What do you want to achieve?
Curtains closing and opening on click. -
What is the issue?
Curtains are not teleported to the desired position. Instead the position will be teleported 100 studs away or something. -
What solutions have you tried so far?
I didn’t find anything that could help me.
My Script:
local leftcurtain = script.Parent.Parent.LeftCurtain
local rightcurtain = script.Parent.Parent.RightCurtain
--
local openrightcurtain = script.Parent.Parent.OpenRightPos
local openleftcurtain = script.Parent.Parent.OpenLeftPos
--
local closerightcurtain = script.Parent.Parent.ClosedRightPos
local closeleftcurtain = script.Parent.Parent.ClosedLeftPos
--
local clickdetector = script.Parent.ClickDetector
--
clickdetector.MouseClick:Connect(function(Click)
if script.Parent.Parent.Closed.Value == false then
leftcurtain.Position = Vector3.new(closeleftcurtain.Value)
rightcurtain.Position = Vector3.new(closerightcurtain.Value)
script.Parent.Parent.Closed.Value = true
else
leftcurtain.Position = Vector3.new(openleftcurtain.Value)
rightcurtain.Position = Vector3.new(openrightcurtain.Value)
script.Parent.Parent.Closed.Value = false
end
end)
Yes, the curtains are anchored.
Path: