Vector

Vector is a Table that has keys x,y,z and 1,2,3. Vector can represent position, rotation, direction, etc.

Keys

Key LetterKey Number
x1
y2
z3

Types

TypeDescriptionRange
PositionPoint in Space-Bounds to Bounds
RotationAngle Degrees-180 to 180
DirectionVector Direction-1 to 1

Ex:
local position = obj.getPosition()
print(position.x, position.y, position.z)
print(position[1], position[2], position[3])
print(“Both are the same”)
local new_position {x = 0, y = 5, z = 0}
obj.setPosition(new_position)


Vector has duplicate keys so you can create it with shorthand.
Ex: local position = {0.5, 1, 0.5}

If Vector has mismatch between its x,y,z and 1,2,3 keys the x,y,z keys will take precedence if they exist in the Table.