Model not changing CFrame

My problem is the model is not changing CFrame and it does not have error, model has primary part.

local players = game:GetService('Players')

players.PlayerAdded:Connect(function(player)
	local valueAssets = Instance.new('Folder', player)
	valueAssets.Name = 'valueAssets'
	
	local division = Instance.new('StringValue', valueAssets)
	local subdivision = Instance.new('StringValue', valueAssets)
	
	local isOnMainTeam = false
	
	local function makeBeltForPlayer(char)
		local belt = game.ServerStorage.Belt:Clone()
		local lowertorso = char.LowerTorso
		
		local weld = Instance.new('WeldConstraint', lowertorso)
		weld.Part0 = lowertorso
		weld.Part1 = belt.Middle
		
		belt.Parent = char
		belt:SetPrimaryPartCFrame(belt:GetPrimaryPartCFrame() * lowertorso.CFrame)
	end
	
	player:GetPropertyChangedSignal('TeamColor'):Connect(function()
		if player.TeamColor == game.ReplicatedStorage.MainTeam.Value then
			isOnMainTeam = true
		else
			isOnMainTeam = false
		end
	end)
	
	player.CharacterAdded:Connect(function(character)
		if isOnMainTeam then
			task.wait(.1)		
			makeBeltForPlayer(character)
		end
	end)
end)

The belt didn’t change CFrame. PrimaryPart is middle.

image

Each part inside has WeldConstraint.

1 Like

I used :PivotTo then I got teleported to random position,
I used :SetPrimaryPartCFrame then I saw a belt below me.

Two of them not working.

1 Like

What did you exactly write, when you did “:PivotTo” please post it here. :slight_smile:

Edit: Are you trying to make a belt accessory for the character?

1 Like

belt:PivotTo(lowertorso.CFrame)

Yes.

belt:PivotTo(lowertorso.CFrame)

Yes. I just made it myself.

You should do it differently then. :slight_smile:

  • Testplay your game, go to workspace and find your character, go under “LowerTorso” and copy the “waist-attachment” thing.
  • Now paste that into your belt model, and it should work, as long as you have made the accessory correctly.

image
Which one. Oh nvm,

Nope.


Above the belt is a character.
Belt is on below of me.

local function makeBeltForPlayer(char)
		local belt = game.ServerStorage.Belt:Clone()
		local lowertorso = char.LowerTorso
		local Attachment = lowertorso.WaistCenterAttachment
		
		local weld = Instance.new('WeldConstraint', lowertorso)
		weld.Part0 = lowertorso
		weld.Part1 = belt.Middle
		
		belt.Parent = char
		belt:PivotTo(Attachment.CFrame)
	end

Alright I just fix it by using weld after setting the CFrame in script.
Thx to @TortenSkjold for helping.