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

How do i clone a part and its exact position and rotation?

Asked by 8 years ago

I am curious on how to clone a part in its exact form and position. I am not fluent in fromEulerAngles.

2 answers

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

Ummmm.... You use clone?

local clo = game.Workspace.Part:clone()

Clone copies all attributes of a part.

0
so sassy c; Goulstem 8144 — 8y
0
lol @Goulstem c: Shawnyg 4330 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

If Shawnyg's answer was not helpful, you just set the properties to the old part's properties:

function partClone(obj)
    local c = obj:Clone()
    c.CFrame = obj.CFrame -- sets rotation and position
    c.Size = obj.Size -- size
    c.Parent = obj.Parent -- puts into the parent of the cloned part
end

partClone(game.Workspace.BasePlate)
0
Shawnyg's works perfectly. Goulstem 8144 — 8y
0
fight fight fight alphawolvess 1784 — 8y
0
-_- it was just a foolproof answer gg TheDeadlyPanther 2460 — 8y

Answer this question