local camDirection = hrp.CFrame:ToObjectSpace(cam.CFrame).LookVector
I understand except for .LookVector. I know the LookVector is indicating a forward direction(0, 0, -1)
but
CFrame of cam(CurrentCamera) measured hrp(HumanoidRootPart) to center of world + LookVector
It doesn’t make any sense to me. Can you explain this code?
Also What is Lookvector for? cam or hrp
Well… it’s lookvector, where the CFrame is facing. You can use this to calculate directions (for velocity and stuff). I’ve prepared a video that shows this:
(the side with the random decal is the front, you don’t need to watch the whole video)
Anyways, I believe this would give the direction from the camera to the humanoidRootPart (or the other way around). Here’s a link about worldspace if you need it