CFrame.LookVector giving me a crazy value when it should just be (0,0,-1)

I am currently working on some Ai Code for a bot im making and i came across an issue that makes no sense at all and its preventing me from finishing the code

To describe the issue simpler, I’ve made a separate script and literally just used a base part to test this issue. When setting a part to a new/blank CFrame, its orientation is 0,0,0 which causes the parts LookVector to be 0,0,-1

I want the part to be facing the other direction so that its looking up the Z Axis, so i simply rotated the cframe by 180 degrees like this
image

i expect that the LookVector return 0,0,1
but instead it returns 8.742277657347586e-08, -0, 1

and before anybody says anything i tried moving the part forward 1 stud using the lookvector (as shown in the code above) AND IT WORKS PERFECTLY FINE AS IF LOOKVECTOR IS 0,0,1

Ive never been so frustrated at coding because usually it comes down to me making a mistake, but this situation is different, can somebody please help me??
(i NEED the LookVector value, there is no other solution for my Ai Code)

8.742277657347586e-08 is actually just a REALLY small number that approximates to be almost zero so your look vector is pretty much what you want which is 0,0,1

3 Likes

ok I feel like the dumbest person ever now thank you for saying that, I guess this wasn’t the issue with my ai code xd

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