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

why doesn't my model move using cframe?

local rep = game:GetService("ReplicatedStorage")
local pc = rep:FindFirstChild("PC")
local clickd = script.Parent.ClickDetector
clickd.MouseClick:Connect(function()
	if rep and pc then
		pc:Clone()
		pc.Parent = workspace
		pc.CFrame = CFrame.new(128.681, 3.926, 40.64)
	end
end)

this script is parented to a part with a click detector inside of it everything works just fine until the script reaches the CFrame part i know it's about the model im trying to move i guess im not doing it properly any help is apriciated

1 answer

✓ Accepted answer

In order to move an entire model you're going to need to use Model:SetPrimaryPartCFrame(). To set the primary part of your model, simply click the model you wish to move and there will be a PrimaryPart option within properties. Set this to whichever part you intend to act as the sort of base to your model's position then you'll use SetPrimaryPartCFrame which will reposition the entire model based on where the Primary part is put.

2 comments

0

thank you

0

Np

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