I’m not very good with CFrame rotation math. So right now I’m trying to cast a ray that only follows one axis of rotation of a part while maintaining the same constant angle for the rest. Here is an example.
Correct me if I’m wrong but you’re wanting to cast a ray in the direction a part is pointing, but keep it flat (parallel to the ground)?
You can achieve this by getting the lookVector of your part and setting the y (vertical) component to 0;
direction = Vector3.new(part.CFrame.lookVector.X,0,part.CFrame.lookVector.Z).Unit