Model "teleports" up when weld deleted

When script deleted weld from a joint which conected two parts from the model the model teleports up by somewhere 500 studs (the lenght of the model is 960 studs)

Script:

wait(10)
i=0
A=0
B=0
C=0
D=0
while true do
	i=i+0.0001
	print(i)
	script.Parent.CFrame=script.Parent.CFrame*CFrame.Angles(math.rad(0.005*i),0,math.rad(-0.05*i))
	script.Parent.Position=script.Parent.Position+Vector3.new(0,-0.2*i,0)
	wait(0)
	if A==0 and i>0.24 then
		game.Workspace.Titanic.F1.JF1.Weld:Destroy()
		A=1
	end
	if B==0 and i>0.29 then
		game.Workspace.Titanic.F2.JF2.Weld:Destroy()
		B=1
	end
	if D==0 and i>0.31 then --The part where we interested in
		game.Workspace.Titanic.F3.JF3.Weld:Destroy()
		game.Workspace.Titanic.F4.JF4.Weld:Destroy()
		game.Workspace.Titanic.Joint:Destroy()
		game.Workspace.RotationJoint.Weld:Destroy()
		D=1
	end
end

I tried stoping rotation, moving before deleting weld, nothing works. Can you please help?

Video:robloxapp-20211011-2139559.wmv (575.7 KB)

Please help! I’m here one and a half hours without any answer!

I believe it has something to do with this.
also put more wait(n>0) and break

I don’t quite understand. There is no variable n in the script.

well, at least put some wait(n) n is a number greater than 0
then, when your done all the stuff put break to exit while loop
I think that’s all i can help :slightly_smiling_face:

1 Like

Thanks, helped really much! Now I can finally
move to other things!

2 Likes