How do I keep a part from going outside of a certain distance from a part? I got the magnitude part down, I just don't know how to lock the part inside of the distance.
base = script.Parent
if (base.Position - p1.Position).magnitude > 10 then
p1.Anchored = true -- ????
end
Keep in note the part placement is moved by the mouse's position and is updated 1/60 of a second.

1 comment
Do me a favour and mark it as answered if my answer solves this issue.