SetPrimaryPartCFrame() doesnt work on a model

so im creating a game among us-like with 2 friends, we are doing good so far and we are trying to add kill script.

what im having problems with is not the kill itself, but the dead body. so for some reason the body appears in wrong place? im not getting any errors which is weird

i cannot see anything wrong here so any help would be appreciated heres the script

local Remote = game.ReplicatedStorage.Events.Kill
local RS = game.ReplicatedStorage

Remote.OnServerEvent:Connect(function(player,Pos,LV)
	local Player1 = Region3.new(Vector3.new(1,1,1),Vector3.new(6,6,6))
	local visualizePart = Instance.new("Part", game.Workspace)
	visualizePart.Name = "HitboxTest"
	visualizePart.Anchored = true
	visualizePart.Size = Player1.Size
	visualizePart.CFrame = Player1.CFrame
	visualizePart.Color = Color3.new(255,0,0)
	visualizePart.Transparency = 1
	visualizePart.CanCollide = false
	visualizePart.Position = Pos
	local Region = Region3.new(visualizePart.Position-(visualizePart.Size/1.5),visualizePart.Position+(visualizePart.Size/1.5))
	local Parts = workspace:FindPartsInRegion3(Region)
	for i,v in pairs(Parts) do
		print(v)
		visualizePart:Destroy()
		if v:IsA("Part") and v.Name == "HumanoidRootPart" then
			local plr = v.Parent
			print(plr.Name)
			print(plr)
			for i,v in pairs(game.ReplicatedStorage.CustomValues.SelectedPretenders:GetChildren()) do
				if v.Value == player.Name then
					local Check = game.ReplicatedStorage.CustomValues.SelectedPretenders:FindFirstChild(tostring(game.Players[plr.Name].UserId))
					if not Check then
						local Check2 = game.ReplicatedStorage.CustomValues.Ghosts:FindFirstChild(plr.Name)
						if not Check2 then
							if plr.Name ~= player.Name then
								local PlayerF = Instance.new("Folder") 
								PlayerF.Parent = game.ReplicatedStorage.CustomValues.Ghosts
								PlayerF.Name = plr.Name
								local deadbodyclone = RS.DeadBody:Clone()
								deadbodyclone.Parent = game.Workspace.DeadBodies
								deadbodyclone:SetPrimaryPartCFrame(plr:FindFirstChild("Torso").CFrame)
								local text = plr.Head:FindFirstChild("Nickname"):FindFirstChild("TextLabel")
								text.TextColor3 = Color3.fromRGB(255, 255, 255)
								break
							end
						end
					end
				end
			end
		end
	end
end)


thanks!

You don’t elaborate much on what the problem is

is it not changing the primary part cframe? is it rotating differently? is there any error output? do you have images of what the “wrong place” is?

The DeadBody model has a PrimaryPart correct?

i said there is no error. model is not working at all :confused:

yes, i have checked that multiple times.

Try putting it at the players PrimaryPart instead of their Torso. Every character’s PrimaryPart is the HumanoidRootPart. Also, try printing the CFrame you’re setting it to and see if you can find the problem that way.

okay let me try wait, i dont know if studio will load tho. roblox is having problems

How is your model’s primarypart set? Would be helpful to get a picture of it while highlighting the primarypart.

umm i think the matter is not there, it doesnt move at all

Did you print the CFrame you’re setting it to?

i think so im not sure though ima check