I am trying to make a gun that casts a ray out to detect if there is anything for it to hit, but I have run into some trouble. The raycast is not functioning as expected (won't work with an ignore list or creates a ray in a different spot from mouse)
The output is "nil"
local ray = Ray.new(tool.Handle.Position,mouse.Hit.p) local hit, hitPosition = game.Workspace:FindPartOnRay(ray,game.Players.LocalPlayer.Character) print(hit)