Keeping shotgun spread consistent

shotgun spread is based off of mouse position but doesnt stay consistent at different ranges

if gunmodel.Values:FindFirstChild("Shotgun") then
				for i = 1, 12 do
					local randomPos = Vector3.new(math.random(0, 10), math.random(0, 10), math.random(0, 10))
					
					mainmodule.cast(gunmodel.GunComponents.Barrel.Position, mouse + randomPos, 60, damage)
					replicatedstorage.Events.Fire:FireServer(gunmodel.GunComponents.Barrel.Position, mouse + randomPos)
				end
			else
				mainmodule.cast(gunmodel.GunComponents.Barrel.Position, mouse, 60, damage)
				replicatedstorage.Events.Fire:FireServer(gunmodel.GunComponents.Barrel.Position, mouse)
			end

far target
image

near target
image

sorry for bad images its hard to capture it

Fixed - for anyone with this problem in the future, i fixed it by multiplying the offset position by the mouse’s position / 30

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.