Currently, I’m trying to solve a problem in my game.
Shooting at a wall has the intended effect for this demonstration, where the spread pattern is almost flat.
However, when aiming at the ground, it becomes a circular spread pattern. I need it so it’s almost flat no matter what angle you’re shooting.
Here is the ray variable:
local ray = Ray.new(game.Players.LocalPlayer.Character.Head.Position, (mouse.Hit.p - game.Players.LocalPlayer.Character.Head.Position).unit * settings.gunSettings.range + gunset.gunSettings:spreadPattern().unit*chosenSPREAD)
What it looks like when shooting at the wall and how I want it to look when shooting at the ground:
What it looks like shooting at the ground (not intended):
Here’s what SpreadPattern() is:
spreadPattern = function() return Vector3.new(math.random(-1,1),math.random(-0,0),math.random(-1,1)) end,