Would someone explain *in baby terms* what the difference between Udim2, Udim, Vector2, and CFrame is?

Basically, I am trying to play around with Tween Service and Gui but I couldn’t figure out the difference with all these above (Semi-familiar with CFrame but not fully). Even with the documentation. Would someone please explain it in easier terms.

4 Likes

Vector3 is used for coordinate data, the parameters when making and/or reading one would be (X, Y, Z) which would interpreted the same as real life coordinates or direction. For ex, Vector3.new(0,0,0) or Vector3.zero would both be interpreted as the center of your worldspace or workspace. The Unit of a vector compresses (sorta) it into a scale form commonly used for representing direction. CFrame is a little (a lot) more advanced, it contains both direction and positon vector3’s, there’s a lot more to learn for a full understanding of them like Matrixes and quaternion but that’ll likely be years later of learning if you don’t know what Vector3 is rn.
Imagine Udim2/Udim as Vector2’s but with scale and for UI.

1 Like

For vectors and udim, the number that comes after it represents the dimension. Vector3 is three dimensional like the position of objects with an x, y, and z. Vector2 is only two dimensional and has an x and y. As for udim, a udim is like a vector but each degree is broken down into a scale value and offset value. Udim has no number after the name, because it is one dimensional. Udim2 has two dimensions, an x and y, each with their own scale and offset. Typically udim2 is used for the position of things like gui. Lastly, cframe is a combination of multiple vector3s to represent both position and direction.

1 Like

CFrame: A compiler of Vector3’s, usually contains Position + Orientation (Rotation)
Vector3: Coordinates in 3D Space
Vector2: Coordinates in 2D Space Movement (direction and magnitude)
Udim2: General 2D Spaces in GUI Elements, uses Offset and Scale (which Vector2 doesnt have)
Udim: Coordinates in 1D Space (used for size)

3 Likes

clearly people dont know what baby terms means, so im coming to the rescue.

udim2, position on screen (scaleX, offsetX, scaleY, offsetY)
where scale is 0-1, 0 being left, 1 being right

udim, udim2 but only one set rather then two for x, y. (scale, offset)

vector2, a single set of coordinates on a plane. x, y (2d) (x, y)

vector3, a single set of coordinates in the world. x, y, z (3d) (x, y, z)

cframe, two sets of coordinates (vector3s) which are the position and the rotation (3d) (vector3, vector3)

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.