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

What is CFrame? And what do I need to know first before I learn it?

Asked by 4 years ago

Im new at scripting and I noticed CFrame is used a lot. What do I need to learn before I learn CFrame?

0
I found this video quite useful before. https://www.youtube.com/watch?v=SbNcQ8WgUBs Unhumanly 152 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Cframe(abbreviated as Coordinate frame) is known as a data type used to move and rotate an item. It uses GLOBAL coordinates (X, Y, and Z) and rotation data for each axis. As a beginner scripter, I don't use it usually for most of my projects, but that's just me.

While using Cframe, there are several 'constructors' that are used for CFrame.

A simple one can be Cframe.new(). Example:

game.Workspace.Baseplate.CFrame = CFrame.new(1000,1000,1000)

Vector3can also be used. For example, Vector3can be used as showed:

game.Workspace.Baseplate.CFrame = CFrame.new(Vector3.new(1000,1000,1000)) 

Instead of using Cframe, you can use Vector3.new but I'm not forcing you to.

There are more constructors, but those are 2 that were listed.

If you'd like to know more constructors, click below: https://developer.roblox.com/en-us/api-reference/datatype/CFrame

It's directly from ROBLOX, so they should have maybe more information that I put here.

Hoped this helps! :D

Ad

Answer this question