Datatypes
Vector3
https://create.roblox.com/docs/reference/engine/datatypes/Vector3
The Vector3 data type represents a vector in 3D space, typically used as a point in 3D space or the dimensions of a rectangular prism.
Constructors
new
Vector3.new(x: number, y: number, z: number)Returns a new Vector3 from the given x, y, and z components.
zero
Vector3.zero: Vector3Returns a Vector3 with coordinates (0, 0, 0).
one
Vector3.one: Vector3Returns a Vector3 with coordinates (1, 1, 1).
xAxis
Vector3.xAxis: Vector3Returns a Vector3 with coordinates (1, 0, 0).
yAxis
Vector3.yAxis: Vector3Returns a Vector3 with coordinates (0, 1, 0).
zAxis
Vector3.zAxis: Vector3Returns a Vector3 with coordinates (0, 0, 1).
Properties
X
Vector3.X: numberY
Vector3.Y: numberZ
Vector3.Z: numberMagnitude
Vector3.Magnitude: numberReturns the length of the vector.
Unit
Vector3.Unit: Vector3Returns a vector of length 1 pointing in the same direction as the original vector.
Operations
Matcha supports the following mathematical operations on Vector3 types:
- Addition / Subtraction:
Vector3 + Vector3,Vector3 - Vector3 - Multiplication / Division:
Vector3 * Vector3,Vector3 / Vector3,Vector3 * number,Vector3 / number,number * Vector3 - Unary Minus:
-Vector3 - Equality:
Vector3 == Vector3
Methods
Abs
function Vector3:Abs(): Vector3Returns a Vector3 with the absolute value of each component.
Angle
function Vector3:Angle(other: Vector3): numberReturns the angle between the two vectors in radians.
Ceil
function Vector3:Ceil(): Vector3Returns a Vector3 with the components rounded up to the nearest integer.
Cross
function Vector3:Cross(other: Vector3): Vector3Returns the cross product of the two vectors.
Dot
function Vector3:Dot(other: Vector3): numberReturns the dot product of the two vectors.
Floor
function Vector3:Floor(): Vector3Returns a Vector3 with the components rounded down to the nearest integer.
FuzzyEq
function Vector3:FuzzyEq(other: Vector3, epsilon: number): booleanReturns true if the two vectors are approximately equal within the specified epsilon.
Lerp
function Vector3:Lerp(target: Vector3, alpha: number): Vector3Linearly interpolates between the vector and the target vector by alpha.
Max
function Vector3:Max(other: Vector3): Vector3Returns a Vector3 where each component is the maximum of the corresponding components in the two vectors.
Min
function Vector3:Min(other: Vector3): Vector3Returns a Vector3 where each component is the minimum of the corresponding components in the two vectors.
Sign
function Vector3:Sign(): Vector3Returns a Vector3 indicating the sign of each component (-1, 0, or 1).
CFrame
https://create.roblox.com/docs/reference/engine/datatypes/CFrame
The CFrame (Coordinate Frame) data type describes a position and rotation in 3D space.
Constructors
new
CFrame.new()Returns an identity CFrame at position (0, 0, 0) with no rotation.
CFrame.new(x: number, y: number, z: number)Returns a CFrame at position (x, y, z) with no rotation.
CFrame.new(x: number, y: number, z: number, qx: number, qy: number, qz: number, qw: number)Returns a CFrame with position (x, y, z) and rotation defined by quaternion components (qx, qy, qz, qw).
CFrame.new(x: number, y: number, z: number, r00: number, r01: number, r02: number, r10: number, r11: number, r12: number, r20: number, r21: number, r22: number)Returns a CFrame with position (x, y, z) and rotation defined by the rotation matrix components.
CFrame.newexpects exactly 0, 3, 6, or 12 arguments.
Angles
CFrame.Angles(rx: number, ry: number, rz: number)Returns a CFrame with position (0, 0, 0) and rotation defined by the specified Euler angles (in radians).
fromOrientation
CFrame.fromOrientation(rx: number, ry: number, rz: number)Returns a CFrame with position (0, 0, 0) and rotation defined by the specified Euler angles (in radians), applied in YXZ order.
lookAt
CFrame.lookAt(at: Vector3, lookAt: Vector3): CFrameThe constructor is exposed on CFrame. No global Camera constructor table was present in the Matcha 1.0.0 audit.
Properties
X
CFrame.X: numberThe X coordinate of the CFrame's position.
Y
CFrame.Y: numberThe Y coordinate of the CFrame's position.
Z
CFrame.Z: numberThe Z coordinate of the CFrame's position.
Position
CFrame.Position: Vector3The position of the CFrame as a Vector3.
LookVector
CFrame.LookVector: Vector3The forward-pointing unit vector of the CFrame (the negative Z axis).
RightVector
CFrame.RightVector: Vector3The right-pointing unit vector of the CFrame (the X axis).
UpVector
CFrame.UpVector: Vector3The upward-pointing unit vector of the CFrame (the Y axis).
Operations
Matcha supports the following mathematical operations on CFrame types:
- CFrame Multiplication:
CFrame * CFramecomposition. - Vector Transformation:
CFrame * Vector3to transform a point into world space. - Equality:
CFrame == CFrame(uses reference equality).
Methods
GetComponents
function CFrame:GetComponents(): (number, number, number, number, number, number, number, number, number, number, number, number)Returns the components of the CFrame: position x, y, z and the 9 rotation matrix components r00, r01, r02, r10, r11, r12, r20, r21, r22.
Inverse
function CFrame:Inverse(): CFrameReturns the inverse of this CFrame.
Lerp
function CFrame:Lerp(target: CFrame, alpha: number): CFrameLinearly interpolates between this CFrame and the target CFrame by alpha.
PointToObjectSpace
function CFrame:PointToObjectSpace(v: Vector3): Vector3Transforms a Vector3 point from world space to the CFrame's local object space.
PointToWorldSpace
function CFrame:PointToWorldSpace(v: Vector3): Vector3Transforms a Vector3 point from the CFrame's local object space to world space.
ToEulerAnglesXYZ
function CFrame:ToEulerAnglesXYZ(): (number, number, number)Returns the Euler angles (in radians) of this CFrame using XYZ order.
ToOrientation
function CFrame:ToOrientation(): (number, number, number)Returns the Euler angles (in radians) of this CFrame using YXZ order.
VectorToObjectSpace
function CFrame:VectorToObjectSpace(v: Vector3): Vector3Transforms a Vector3 vector from world space to local object space.
VectorToWorldSpace
function CFrame:VectorToWorldSpace(v: Vector3): Vector3Transforms a Vector3 vector from local object space to world space.
Vector2
https://create.roblox.com/docs/reference/engine/datatypes/Vector2
The Vector2 data type represents a 2D value with direction and magnitude. Some applications include GUI elements and 2D mouse positions.
Constructors
new
Vector2.new(x : number, y : number)Returns a Vector2 from the given x and y components.
Properties
X
Vector2.X: numberY
Vector2.Y: numberColor3
The Color3 data type describes a color using red, green, and blue components in the range of 0 to 1. Unlike the BrickColor data type which describes named colors, Color3 is used for precise coloring of objects on screen through properties like BasePart.Color.
Constructors
new
Color3.new(red: number, green: number, blue: number)Returns a Color3 with the given red, green, and blue values.
fromRGB
Color3.fromRGB(red: number, green: number, blue: number)Returns a Color3 from given components within the range of 0 to 255.
fromHSV
Color3.fromHSV(hue: number, saturation: number, value: number)Returns a Color3 from the given hue, saturation, and value components.
fromHex
Color3.fromHex(hex: string)Returns a Color3 from a given hex value.
Properties
R
Color3.R: numberG
Color3.G: numberB
Color3.B: numberNumberRange
NumberRange
NumberRange.newThe NumberRange constructor table and NumberRange.new function are exposed. Constructor behavior and instance properties were not invoked by the safe audit.
RaycastParams
RaycastParams
RaycastParams.newThe RaycastParams constructor table and RaycastParams.new function are exposed. Constructor behavior and properties were not invoked by the safe audit.
Enum
The following groups and items are exposed in Matcha 1.0.0:
Enum.KeyCode
Enum.KeyCode.F1
Enum.KeyCode.Insert
Enum.KeyCode.LeftShift
Enum.UserInputType
Enum.UserInputType.Keyboard
Enum.UserInputType.MouseButton1
Enum.UserInputType.MouseMovement
Enum.RaycastFilterType
Enum.RaycastFilterType.Exclude
Enum.RaycastFilterType.BlacklistBoth Enum.RaycastFilterType.Exclude and Enum.RaycastFilterType.Blacklist resolve to EnumItem values.
Ray
https://create.roblox.com/docs/reference/engine/datatypes/Ray
Constructors
new
Ray.new(origin: Vector3, direction: Vector3): RayCreates a ray from an origin and direction.
Properties
Origin
Ray.Origin: Vector3Direction
Ray.Direction: Vector3Unit
Ray.Unit: RayMethods
ClosestPoint
function Ray:ClosestPoint(point: Vector3): Vector3The member is exposed as a function. The safe audit did not invoke it.
Distance
function Ray:Distance(point: Vector3): numberThe member is exposed as a function. The safe audit did not invoke it.
UDim
https://create.roblox.com/docs/reference/engine/datatypes/UDim
Constructors
new
UDim.new(scale: number, offset: number): UDimProperties
Scale
UDim.Scale: numberOffset
UDim.Offset: numberUDim2
https://create.roblox.com/docs/reference/engine/datatypes/UDim2
Constructors
new
UDim2.new(xScale: number, xOffset: number, yScale: number, yOffset: number): UDim2fromScale
UDim2.fromScale(xScale: number, yScale: number): UDim2fromOffset
UDim2.fromOffset(xOffset: number, yOffset: number): UDim2Properties
X
UDim2.X: UDimY
UDim2.Y: UDimWidth
UDim2.Width: UDimVerified to return the same UDim value as X.
Height
UDim2.Height: UDimVerified to return the same UDim value as Y.
Methods
Lerp
function UDim2:Lerp(target: UDim2, alpha: number): UDim2The member is exposed as a function. The safe audit did not invoke it.