I want the ray to face down but i cant seem to do it heres what i have so far
local ray = Ray.new(tool.Handle.CFrame.p, CFrame.new(0,tool.Handle.CFrame.y.unit*10,0))
To make the code readable and not trying to jumble it up all on one line, you need to get the direction of the bottom surface of the the tool is facing.
The supported API for turning an object-space direction (the downward direction) to a world-space direction, is as follows:
CFrame :vectorToWorldSpace(Vector3)
So, what is the direction of "down" in the world-space? It is:
Vector3.new(0,1,0)
Let's use that as our object-space. In object-space, that vector always points down no matter how it's rotated. So we do this to get the downward direction, no matter the rotation, from object-space to world-space.
local DownVector = tool.Handle.CFrame:vectorToWorldSpace(Vector3.new(0,-1,0))
Now, combine that code with what you have to get the ray to face down - no matter how the handle is facing:
local DownVector = tool.Handle.CFrame:vectorToWorldSpace(Vector3.new(0,-1,0)) local ray = Ray.new(tool.Handle.CFrame.p, DownVector)
EDIT Fixed downward vector direction