I don't understand CFrame, specifically RightVector, UpVector, and LookVector

CFrame has always being the one of the most confusing thing to learn for me, just below metatable. Not about the position and orientation, since its clear enough, but its about the trio RightVector, UpVector, and LookVector. Ignore the other trio XYZ since i haven’t learned anything about it as for now.

I looked up forums thread and dev documentation page, and for better understanding, i scripted it in studio to check how value behave, but its still being confusing even now. I think i kinda understand that RightVector is X of orientation, UpVector is Y of orientiation, LookVector is Z of orientation. But in experiment, its just a number that can only range from 0 to 1? From the source i looked up, its a unit number, but what is a unit number? How does it calculated?

Can anyone explain this three to me in an easy to understand explaination, or if they have other good source of information to look up?

1 Like

The Right/Up/LookVectors are unit/normalized vectors which indicates the direction of the CFrame. This can be used in ray casting, for example ray casting the direction the camera is looking would use Camera.CFrame.LookVector * raylength. You can also easily get the “BackVector” or “LeftVector” by taking the LookVector and multiplying it by -1.
You can also use these vectors to move something along that vector by adding it to the original position

1 Like

Call me an idiot or just lazy, but only after writing this thread, then perform another learning experimentation by creating a part that constantly print their respective right up and look then rotate it exactly 90 degree that i finally understand how it work. And i guess thanks to your reply, since it clear up a lot and confirm my theory on how it actually function


(For anyone curious about my learning process, its quite funny, but sometimes you must do absurd approach to understand something i guess?)

So if im not wrong, Right - represent the X or red face - , Up, - represent the y, green face- and Look -represent Z, blue face- vector is the direction of where the CFrame is facing, and the number ranging from -1 to 1 would indicate had the cframe is moved to said direction by say, 1 studs. It will add to XYZ position by respective vector

I dont know how to explain it properly either, since its just now that i understand it. But its feels really “eureka” to finally understand it

exactly, they’re the normals of each face and normalized so if you add it to the position it’ll only move by 1 stud

I know this is answered but in the most simplest terms:

LookVector, UpVector and RightVector as the name suggests are vectors which represent the direction of an object. Look means the front side, Up means the top part and Right means the right side. These vectors have a magnitude of exactly one.

1 Like

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