Glove MeshPart with Bones Moves Incorrectly When Position is Changed via Script

I’m having an issue with a Glove MeshPart where changing its position through a script only moves the pivot point, not the entire mesh.

The Problem

I have imported a mesh (from Blender) into Roblox Studio that has armature bones. I need to manage its position through a script. However, when I change the Position or CFrame property, only the pivot point moves to the new location. The visual mesh itself either stays in its original position or moves in a broken way, disconnected from its pivot.

  • What I expect: The entire mesh and its bones to move seamlessly to the new position.
  • What happens: The pivot moves, but the mesh geometry does not follow correctly.

Replication Steps

  1. Insert a MeshPart with bones and skinning.
  2. Run a simple script to change its position with a motor6d and to be attached with a right or a left hand of the character
  3. Observe that the mesh visual does not follow the pivot.

ScreenShots and Videos

  1. What iam Seeing:


    (It sometimes make the glove on a right hand and the pivot on the left)

  2. The Glove Structure:

  3. Video For What Happend:

My LocalScript Code

Here is the script I am currently using:

local replicatedStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local player = players.LocalPlayer
local part = workspace:WaitForChild("Part")
local proximity = part:WaitForChild("ProximityPrompt")
local gui = script.Parent:WaitForChild("ShopGui2")
local frame = gui:WaitForChild("Frame")
local scroll = frame:WaitForChild("Scroll")
local template = scroll:WaitForChild("Template")
local close = frame:WaitForChild("Close")

local items = require(replicatedStorage:WaitForChild("Items"))
local glovesFolder = replicatedStorage:WaitForChild("Gloves")

local function clearItems()
	for _, child in pairs(scroll:GetChildren()) do
		if child ~= template and child:IsA("Frame") then
			child:Destroy()
		end
	end
end

local function equipGloves(gloveName)
	unequipGloves()

	local gloveModel = glovesFolder:FindFirstChild(gloveName)
	if not gloveModel or not gloveModel:IsA("Model") then
		warn("Glove model not found:", gloveName)
		return
	end

	local character = player.Character or player.CharacterAdded:Wait()
	local rightHand = character:FindFirstChild("RightHand") or character:FindFirstChild("Right Arm")
	local leftHand = character:FindFirstChild("LeftHand") or character:FindFirstChild("Left Arm")

	if not rightHand or not leftHand then
		warn("Could not find hands on character")
		return
	end

	local rightGloveMesh = gloveModel:FindFirstChild("RightHand")
	local leftGloveMesh = gloveModel:FindFirstChild("LeftHand")

	if not rightGloveMesh or not leftGloveMesh then
		warn("Could not find glove mesh parts in model:", gloveName)
		return
	end

	local clonedRightGlove = rightGloveMesh:Clone()
	clonedRightGlove.Name = "EquippedRightGlove"
	clonedRightGlove.Parent = character

	local clonedLeftGlove = leftGloveMesh:Clone()
	clonedLeftGlove.Name = "EquippedLeftGlove"
	clonedLeftGlove.Parent = character

	-- Spacial Gloves
	if gloveName == "Diamond" or gloveName == "Golden" then
		clonedRightGlove.BrickColor = BrickColor.new("Bright yellow")
		clonedLeftGlove.BrickColor = BrickColor.new("Bright yellow")
		clonedRightGlove.Material = Enum.Material.Neon
		clonedLeftGlove.Material = Enum.Material.Neon

	elseif gloveName == "Ice" or gloveName == "Frozen" then
		clonedRightGlove.BrickColor = BrickColor.new("Light blue")
		clonedLeftGlove.BrickColor = BrickColor.new("Light blue")
		clonedRightGlove.Material = Enum.Material.Ice
		clonedLeftGlove.Material = Enum.Material.Ice

	elseif gloveName == "Fire" or gloveName == "Inferno" then
		clonedRightGlove.BrickColor = BrickColor.new("Bright red")
		clonedLeftGlove.BrickColor = BrickColor.new("Bright red")
		clonedRightGlove.Material = Enum.Material.Neon
		clonedLeftGlove.Material = Enum.Material.Neon

	elseif gloveName == "Ghost" or gloveName == "Specter" then
		clonedRightGlove.Transparency = 0.7
		clonedLeftGlove.Transparency = 0.7
	elseif gloveName == "Bite" then
		if clonedRightGlove then
			clonedRightGlove.EF.Particle.Enabled = true
			clonedRightGlove.Tounge.Anim.Enabled = true
		else
			warn(clonedLeftGlove.Name .. "Missing smth")
		end
		
		if clonedLeftGlove then
			clonedLeftGlove.EF.Particle.Enabled = true
			clonedLeftGlove.Tounge.Anim.Enabled = true
		else
			warn(clonedLeftGlove.Name .. "Missing smth")
		end
	end

	local rightMotor = Instance.new("Motor6D")
	rightMotor.Name = "RightGloveWeld"
	rightMotor.Part0 = rightHand
	rightMotor.Part1 = clonedRightGlove

	if rightGloveMesh:FindFirstChild("CF") and rightGloveMesh.CF:IsA("CFrameValue") then
		rightMotor.C0 = rightGloveMesh.CF.Value
	else
		rightMotor.C0 = CFrame.Angles(0, math.rad(90), math.rad(180))
	end

	rightMotor.C1 = CFrame.new()
	rightMotor.Parent = rightHand

	local leftMotor = Instance.new("Motor6D")
	leftMotor.Name = "LeftGloveWeld"
	leftMotor.Part0 = leftHand
	leftMotor.Part1 = clonedLeftGlove

	if leftGloveMesh:FindFirstChild("CF") and leftGloveMesh.CF:IsA("CFrameValue") then
		leftMotor.C0 = leftGloveMesh.CF.Value
	else
		leftMotor.C0 = CFrame.Angles(0, math.rad(90), math.rad(-180))
	end

	leftMotor.C1 = CFrame.new()
	leftMotor.Parent = leftHand

	if gloveName == "MP5" or gloveName == "M1911" then
		rightHand.Transparency = 0
		leftHand.Transparency = 0
	else
		rightHand.Transparency = 1
		leftHand.Transparency = 1
	end
	
	

	print("Equipped:", gloveName)
end

function unequipGloves()
	local character = player.Character
	if character then
		local rightGlove = character:FindFirstChild("EquippedRightGlove")
		local leftGlove = character:FindFirstChild("EquippedLeftGlove")

		if rightGlove then rightGlove:Destroy() end
		if leftGlove then leftGlove:Destroy() end

		local rightHand = character:FindFirstChild("RightHand") or character:FindFirstChild("Right Arm")
		local leftHand = character:FindFirstChild("LeftHand") or character:FindFirstChild("Left Arm")

		if rightHand then rightHand.Transparency = 0 end
		if leftHand then leftHand.Transparency = 0 end
	end
end

local function setupGui()
	clearItems()

	for gloveName, gloveData in pairs(items.skins) do
		if gloveData.Shop == true then
			local clonedTemp = template:Clone()
			clonedTemp.Name = gloveName
			clonedTemp.Button.Text = gloveName
			clonedTemp.Parent = scroll
			clonedTemp.Visible = true

			clonedTemp.Button.MouseButton1Click:Connect(function()
				print("Selected skin:", gloveName)
				equipGloves(gloveName)
			end)
		else
			warn(gloveName .. " is unavailable (Shop is false)")
		end
	end
end

setupGui()

proximity.Triggered:Connect(function()
	if gui then
		frame.Visible = true
		setupGui()
	else
		warn("ShopGui not found!")
	end
end)

close.MouseButton1Click:Connect(function()
	frame.Visible = false
end)

player.CharacterAdded:Connect(function(character)
	unequipGloves()
end)

Not a forum bug, should be in Help and Feedback > Scripting Support or Bug Reports > Engine Bugs

1 Like