Weld Constraint Failing When Cloned

hello. So when I clone my mesh, there should be another part inside of it that is welded to the mesh and should look exactly as is before cloned. But my experience suggests otherwise.

When I clone my mesh, the mesh is completely fine, but the part inside the mesh is in the most random position ever possible to mankind.

I tried to anchor both of them, did not work. I tried to not anchor them, did not work. I tried to anchor just the mesh, it does not want to anchor. I tried to just anchor the part, did not work.

Code to clone:

local vf = script.Parent.Values
local rounds = vf.Round
local body = script.Parent.BODY

rounds.Changed:Connect(function(value)
	if value >= 1 then
		print("fired")
		local clone = script.Parent.CommonEChii:Clone()
		local clone2 = script.Parent.CommonEChii:Clone()
		
		clone.Parent = script.Parent
		clone2.Parent = script.Parent
		
		clone.Position = Vector3.new(math.random(40,130),6.645,math.random(-257,-170))
		clone2.Position = Vector3.new(math.random(40,130),6.645,math.random(-257,-170))
		
		clone.CFrame = CFrame.lookAt(clone.Position,body.Position)
		clone2.CFrame = CFrame.lookAt(clone2.Position,body.Position)
	end
	if value >= 20 then
		--summon 4 echiis
	end
	if value >= 35 then
		--summon 7 echiis
	end
	if value >= 50 then
		--summon 10 echiis
	end
end)

image

image

Try doing this

		local posClone1 = Vector3.new(math.random(40,130),6.645,math.random(-257,-170))
		local posClone2 = Vector3.new(math.random(40,130),6.645,math.random(-257,-170))
		
		clone.CFrame = CFrame.lookAt(posClone1 ,body.Position)
		clone2.CFrame = CFrame.lookAt(posClone2 ,body.Position)

Thank you so much! Unlike a lot of people I actually understand the code.

1 Like

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