Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 4 years ago

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..

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 killerbrenden 1537 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

Ad
Log in to vote
0
Answered by 4 years ago

easy just click on the model that you want and set primaryPart to watever you want

Answer this question