Im new at scripting and I noticed CFrame is used a lot. What do I need to learn before I learn CFrame?
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)
Vector3
can also be used.
For example, Vector3
can 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