I wanted to try and make gun spread but every bullet lands in the mouse’s position
It’s not working. As seen here:
https://gyazo.com/ad076addf6e945ada0b5dfe188c62e98
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.
https://gyazo.com/c4e72bcd1b0a68ac325cde01f4b758ff
Thank you!