Instead of the bullet getting out of the barrel. It came out of no where! I dont know whats the problem about this, heres the script:
local maxspread = 10
local spreaddivider = 1
local spreaddistance = Vector3.new(math.random(-maxspread,maxspread)/spreaddivider,math.random(-maxspread,maxspread)/spreaddivider,math.random(-maxspread,maxspread)/spreaddivider)
local direction = (((mousep + spreaddistance) - originpos).Unit) * distance
local midpoint = originpos+direction/2
It seems pretty normal, or is something wrong? Please help!
Now, kinda see the problem. Lower the down the maxspread to 1.5 or 1.75 or something like that. And, change the spreaddivider around 65-80, and then maybe try?
EDIT:
This is what happens when I try 1.5 / 70
1.5 / 65
1.75 / 80
Approximately you get 0.021 as your result.
EDIT 2: Your spreaddivider will affect your spreading as I noticed. The higher it is, the lower it spreads.
EDIT 3: Your code is correct, it’s just the variables you need to mess with.
Pretty weird if you ask me. What other place of the code do you think is the reason for this? (Not in the code you provided, the full code you have right now.)