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

How can I move the children of this model at the same time without having to do individual code?

Asked by 6 years ago

function onTouch() Cage = game.Workspace.Cage:GetChildren() for x = 0, 15 do wait(.05) Cage.CFrame = Cage.CFrame + Vector3.new(0,0,.63) end end script.Parent.Touched:connect(onTouch) I'm trying to get all the children to move with eachother.

0
please try to format your questions abnotaddable 920 — 6y

1 answer

Log in to vote
0
Answered by
DanzLua 2879 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

You can use :SetPrimaryPartCFrame() a function of models, which can be used when a model has a primary part set. Use it like it

local model = workspace

model:SetPrimaryPartCFrame(CFrame.new(0,0,0))

The function takes a CFrame argument and moves the entire model relative to the primary part

0
Ty! EmptyScythe 0 — 6y
0
@EmptyScythe accept answer ;p DanzLua 2879 — 6y
Ad

Answer this question