I need help with positioning, vector3

  1. What do you want to achieve?
    Curtains closing and opening on click.
  2. What is the issue?
    Curtains are not teleported to the desired position. Instead the position will be teleported 100 studs away or something.
  3. 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:
path

Can you share the values of the string values? AKA

https://gyazo.com/3807f5a1cb20d16955090f9cf36364ea


These are all the values

Turn them into Vector3values. Then remove Vector3.new from the curtain.positon =

This will change the script to

clickdetector.MouseClick:Connect(function(Click)
	if script.Parent.Parent.Closed.Value == false then
		leftcurtain.Position = closeleftcurtain.Value
		rightcurtain.Position = closerightcurtain.Value
		script.Parent.Parent.Closed.Value = true
	else
		leftcurtain.Position = openleftcurtain.Value
		rightcurtain.Position = openrightcurtain.Value
		script.Parent.Parent.Closed.Value = false
	end
end)```
1 Like

Thank you so much, it worked for me this means really a lot to me. You saved my day.

1 Like