How to detect Align Position finished?

Does anyone know how to make a script that detects if a part finishes AlignPosition?

1 Like

You can check if your Part.Position is equal to your AlignPosition.Position.

I tried this but it didn’t work

while task.wait() do
if script.Parent.AlignPosition.Position == workspace.Part.Position then
break
end
end

It won’t be the same, just check the difference between both positions and see if it’s low enough.

Code:

while task.wait() do
	local difference = (script.Parent.AlignPosition.Position - workspace.Part.Position).Magnitude
	
	if difference < 1 then
		break
	end
end
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.