:MoveTo Not Working

It supposed to move the “gibbed” part of the head over to an attachment but for some odd reason the
head is going to the position of the head. Any ideas?
image

local things = game.ReplicatedStorage.gmodels.Head
local headgib = things.gibbedhead
local motor = Instance.new("Weld")
local disval = script.Parent.limbstats.head.health
disval:GetPropertyChangedSignal("Value"):Connect(function()
	if disval.Value <= 0 then
		headgib:Clone().Parent = script.Parent.weldedgibs
		print("gib")
		headgib.GibbedHead.gibatch:Clone().Parent = script.Parent.Head
		motor.Part0 = script.Parent.weldedgibs.gibbedhead.GibbedHead
		motor.Part1 = script.Parent.Head
		motor.Parent = script.Parent.weldedgibs.gibbedhead.GibbedHead
		headgib:MoveTo(script.Parent.Head.gibatch.WorldPosition)
		local face = script.Parent.Head:FindFirstChildWhichIsA("Decal")
		face:Destroy()
		script.Parent.Head.Transparency = 1
		script.Parent.weldedgibs.gibbedhead.GibbedHead.Headgib:Play()
	end
	end)


1 Like

You aren’t positioning the attachment? You are just parenting it to the head, so the position of it is the position of the head.

I’ve tried that already. I have no idea what im doing wrong.
image

		headgib.GibbedHead.gibatch:Clone().Parent = script.Parent.Head
		script.Parent.Head.gibatch.Position = Vector3.new(0, -0.361, 0)

This script is very difficult to read. You are doing a bunch of :Clone()ing without using variables. Have you tried assigning this a variable? It looks like you’re calling :MoveTo() on the model in ReplicatedStorage, NOT the one that’s in the workspace/you can see.

I fixed the code just now. I made the original code around 2:04am. I was moving the one in replicated storage and using :MoveTo after i welded it.