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

why doesn't my model move using cframe?

Asked by
seikkatsu 110
4 years ago
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

Log in to vote
1
Answered by 4 years ago

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.

0
thank you seikkatsu 110 — 4y
0
Np XxTrueDemonxX 362 — 4y
Ad

Answer this question