I’m trying to raycast 2 studs infront of the HumanoidRootParts based on its current rotation. I thought it’d be simple but what I have currently doesn’t work at all, it just gets random results.
CFrame enables you to get a position relative to a direction. (CFrames are quaternions which store both positional and rotational data)
Vectors only store positional data.
Try this out:
local LENGTH = 2
--//LookVector is the forward component of the CFrame, so it'll be the looking direction, hence the name
local rayDirection = humanoidRootPart.CFrame.LookVector.Unit*LENGTH