Getting a direction that a part is facing

Hello! I wanted to know how to get the vector in which the part’s front face is facing. For example, if the part is facing towards -X, the direction would be Vector3.new(0,0,-1).

I believe I already know how to do this, however my gut is screaming at me for it and believes that there is a better way to do it.

local part = workspace.Part
local cframe = part.CFrame
local forward = cframe * Vector3.new(0,0,-1) -- Gives the position of the CFrame 1 stud forward
local direction = forward - cframe.Position

If you know a better way I could do this, let me know.

Thank you!

you can just get the CFrame’s LookVector

local forward = Part.CFrame.LookVector
1 Like

Have you tried using LookVector?

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