So I am currently trying to make bullet spread on a shotgun, but uh… the bullets just sort of do their own thing when
RayCast.Direction > 0. I’ve tried to fix it in every way I could think of, at this point I’m just stumped and have no idea what to do.
Here is the code:
local Shots = 10; for Index = 1, Shots do local OffsetDegrees = (((360 / Shots) * Index) + math.random(-36, 36)); local NewRayTarget = (CFrame.new(RayCast.Origin) * CFrame.Angles(math.rad(OffsetDegrees), 0, 0) * CFrame.new(RayCast.Direction) * CFrame.new(0, 0, 10)); local FinalRay = Ray.new(RayCast.Origin, NewRayTarget.Position); BulletsReturn[Index] = Bullets.CreateBullet(Player, FinalRay); end;
RayCast = Ray.new(LocalPlayer.Character.Head.Position, Mouse.Hit.LookVector)
Here is a video demonstration of what I mean: