In the script below, how can I set rayDest to where my mouse is pointing? I've tried GetMouse for what I am trying to do but it didn't work in-game.
local tool = script.Parent.Parent
local rayDest = Vector3.new(0, 100, 0)
function onActivation()
local ray = Ray.new(script.Parent.Position, rayDest)
local hit,position = workspace:FindPartOnRayWithIgnoreList(ray, {script.Parent})
if hit then
print(hit.name)
end
end
tool.Activated:Connect(onActivation)

2 comments
It doesn't work in-game.
^ I’ll try to find the problem and fix it soon, but for now you’ll have to wait.