From Goodblox Wiki
Jump to navigationJump to search

Vector3 handles inputs that need three values. It's not a hard concept once you get passed that.

Vector3 has three values, an X ordinate, Y ordinate and Z ordinate. It represents a position in 3D space, just as a coordinate plane that you use in school, and can be in anything that needs to have a set of three values in order to function. (For example an object position, size, et cetera).

All [[Property|properties] are read-only. However, they can be changed via scripts.

Property Type Description
x number the x-coordinate
y number the y-coordinate
z number the z-coordinate
unit Vector3 a normalized copy of the vector
magnitude number the length of the vector


Vector3 is three values. An X (Horizontal), a Y (Vertical), and a Z (Depth). Learning Vector3 is the first step to learning how to move a brick and/or a character.


A brick is on the position line of 0,10,0. It has three vectors (x=0, y=10, z=0). Now let's convert it to Vector3.

local pos =,10,0)

You don't need to put it in a variable, it is just that a variable is much easier to use. I will teach you about "" later on. You see the term "", then 3 numbers seperated by commas inside two parentheses. The "0" is the x vector, the "10" is the y vector, and the other "0" is the z vector (, y, z).

Creating New Vectors

So now you want to teleport bricks? Here, we'll talk about "". When changing an object's position, you either use CFrame or "".

local brick = workspace.Part
brick.Position =,10,0) --Sets the part's x, y, and z coordinates.

In that example, we have,10,0), where X=0, Y=10, and Z=0.

See Also