opened = false
script.Parent.ClickDetector.MouseClick:connect(function(oc)
if opened == false then
script.Parent.Rotation = Vector3.new(0,90,0)
script.Parent.Position = script.Parent.Position + Vector3.new(1.5,0,0)
opened = true
elseif opened == true then
script.Parent.Rotation = Vector3.new(0,0,0)
script.Parent.Position = script.Parent.Position + Vector3.new(-1.5,0,0)
opened = false
end
end)
This is a door that I'm want to open and close on click. It's not animated, it's just a static close/open. The issue is that for some reason if someone is touching the door while it opens or closes, the door spawns above the person for some reason. Why is it doing this? Please help.

1 comment
try using CFrame instead of position