Alright so I’m working on a gun system, learning about creating one myself, I made an actual system where the bullet travels, but I also made a module script with gun settings I set up…
So my problem is when full auto is false the bullet spawns in front of the gun and does it’s thing, but when it’s on full auto the bullet spawns in like couple feet away from the gun, I even tried an auto clicker and that worked fine, maybe it’s the function that I misdone?
Non-auto:
(Bullet starts from gun)
Full-auto:
(Even if I use auto clicker when it’s not full auto and no firerate it still starts from the gun, but when full auto is enabled it does not)
Click functions:
Non-auto:
tool.Activated:Connect(function()
if gunsettings.auto == true then return end
onfire(mouse)
end)
Full-auto:
mouse.Button1Down:Connect(function()
if gunsettings.auto == false then return end
mousedown = true
onfire(mouse)
end)
Onfire:
function onfire(mouse)
if auto == true then
while mousedown == true do
if isshooting == false then
isshooting = true
script.Parent.Handle.Fire:Play()
createray(mouse)
wait(firerate)
isshooting = false
end
wait()
end
elseif auto == false then
if isshooting == false then
isshooting = true
script.Parent.Handle.Fire:Play()
createray(mouse)
wait(firerate)
isshooting = false
end
end
end
Its defiantly coming out the front since if you look at it there’s a slight white line from where it spawns. To me it just seems for some reason why it doesn’t look like it is since maybe the bullet is going out to fast…
There are many reasons that might cause this, we can’t tell for sure.
Check out maybe the bullet is CanCollide and Collides with the reset of the bullets.
Also, it would be helpful to send your code so we can understand the source of the issue.
I want to assume it is an issue related to the bullet being incredibly fast, but as you showed it only happens once Auto is on. Are you calling the same functions in both Auto and non-Auto?
that’s not the case, I’ve shot with an auto clicker which is wayy faster than full auto, once full auto is enabled the bullet spawns further than the barrel