I wanted to try and make gun spread but every bullet lands in the mouse’s position
It’s not working. As seen here:
I tried looking through gun spread threads but that didn’t help at all
Here’s the simple raycast code down here V
local CF = CFrame.new(FromP,ToP)*CFrame.Angles(math.rad(math.random(-module.Spread,module.Spread)),math.rad(math.random(-module.Spread,module.Spread)),0) local DirVec = CF.LookVector local RayCast = Ray.new(FromP, (ToP-FromP + DirVec).unit*module.Range) local part, Position = game.Workspace:FindPartOnRay(RayCast, Player.Character, false, true)
I’ve also printed the DirVec but it works correctly.