you could try doing cframe:VectorToObjectSpace(), i think (?) it might work. if im not wrong it just makes the world axes relative to your cframe’s axes, IF IM NOT WRONG.
also remember that raycasts return nil if they dont hit anything.
Cf:PointToWorldSpace(v): takes a Vector V specified in the axes of Cf, and converts it to the space that Cf is defined it. If Cf is the CFrame of a part, that is world space.
Cf:PointToObjectSpace(v): is the inverse of PointToWorldSpace, so it will take a vector specified in the same axes as Cf, and convert it to one specified in the axes of Cf.
One undoes the other, so Cf:PointToObjectSpace(Cf:PointToWorldSpace(v)) == v
VectorToObjectSpace and VectorToWorld space do the same thing but do not consider the position component of Cf.
IIRC: (Cf - Cf.Position):PointToObjectSpace(v) == Cf:VectorToObjectSpace(v)
I would say its the other way around. You can treat the CFrame as if its a function that turns one vector into a position in another space, such as world space.