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

Can you CFrame with scripts?

Hi, I wanna know how to CFrame with scripts. When you CFrame without scripts in my opinion, It isn't perfect. So how about CFraming with scripts. It'll probably be perfect. Not everything is perfect. Just like probably 80.9% will help. Designing games is all about the building and like 50% of it is CFramed. So can you CFrame with scripts?

3 answers

✓ Accepted answer

Yes. You can CFrame a parts position by doing the following.

Workspace.Part.CFrame = CFrame.new(0, 0, 0)  -- XYZ

You can CFrame the rotation

CFrame.Angles(number rx, number ry, number rz) -- r means in radians

Yes. In fact, the CFraming you probably mean uses a GUI (Graphical User Interface) - probably a plugin - to help you move parts.

In fact, this is controlled by a script.

I have the idea that you haven't got into basic scripting yet. I suggest you get into basic scripting first before going to CFrames. CFraming isn't hard, but you will need a mathematical basis for it first, otherwise you will end up in - sometimes - endless "trail and error", which is not the way how you should do it.

1 comment

0

I'm learning basic scripting by a friend, So I might get the hang of it.

Depends on what the script is. If it was a part and your trying to weld it then it would be

variable = Instance.new("Weld")
variable.Part0 = --part of what you want it to be welded to
variable.Part1 = --the name of your part
variable.C0 = CFrame.new(0, 0, 0) * CFrame.fromEulerAngles(0, 0, 0) --If you want angles, but it dosent have to be just fromEulerAngles, it could be CFrame.Angles(0, 0, 0) and there is other C0's

there is C1 but that's all ive heard.

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