Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you fix "Model:GetPrimaryCFrame() failed because no PrimaryPart has been set"?

So I was trying to make a morph GUI, even tried to follow tutorials and browsed online for sources. Anyway, I kept having this specific error:

"Model:GetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this.

Here's the script in problem in ServerScriptService:

local event = game.ReplicatedStorage.ChangeChar

event.OnServerEvent:Connect(function(player,model)
	local Char = model:Clone()
	local Pos = player.Character:GetPrimaryPartCFrame()
	player.Character:Destroy()
	player.Character = Char
	Char.Parent = workspace
	Char:SetPrimaryPartCFrame(Pos)
end)

If you have any tips for a morph GUI though to fix this entire mess, I'd gladly listen..

1 comment

0

If you want to make a MorphGUI, you can use a ViewPort frame which puts models in UI perspective. https://developer.roblox.com/en-us/articles/viewportframe-gui

2 answers

✓ Accepted answer

It's easy! Just follow these 2 simple steps:


1

Select the model.


2

Go to properties and where is says primary part just click on that and individually select the part you want to be the primary part in the explorer.


And there you have it. It should set your model's position to your Pos variable.

All the best,

PrismaticFruits

This discussion is preserved as it was. New answers, comments, and votes are closed.