I have a part that becomes unanchored. When it becomes anchored, the position isn't the same as before. What I'm trying to do is move the part to the position it was at before, but this script doesn't move it all the way; it's off by about 0.2 studs on at least 1 axis all the time.
k = true
while k do
wait(0.01)
if script.Parent.Value ~= script.Parent.Parent.Position then -- The script's parent is a Vector3Value which holds the position the part will go to and the script's parent's parent is a part.
script.Parent.Parent.Position = script.Parent.Value
end
end
I checked to make sure the Value is correct, and it is. The value and the part's position are still different by 0.2 or so, even if the script is constantly checking if it isn't. Any help on how to move the part perfectly to its correct position?

1 comment
Alright, that helped. Now I need to do the same thing but instead of position I need to do rotation, but I don't know how to do that. Could you help me on that?