--------------------[ TEXTURE CREATION FUNCTIONS ]------------------------------------


function createBullet(Direction)
	local Origin = Gun.Main.CFrame.p
	local bulletCF = CF(Origin, Origin + Direction)
	local Bullet = Instance.new("Part")
	Bullet.BrickColor = S.bulletSettings.Color
	Bullet.Material = Enum.Material.Neon
	Bullet.Name = "Bullet"
	Bullet.CanCollide = false
	Bullet.FormFactor = "Custom"
	Bullet.Size = S.bulletSettings.Size
	Bullet.BottomSurface = "Smooth"
	Bullet.TopSurface = "Smooth"
	if math.min(S.bulletSettings.Size.X, S.bulletSettings.Size.Y, S.bulletSettings.Size.Z) < 0.2 then
		local Mesh = Instance.new("BlockMesh")
		Mesh.Scale = S.bulletSettings.Size / Vector3.new(
			math.max(S.bulletSettings.Size.X, 0.2),
			math.max(S.bulletSettings.Size.Y, 0.2),
			math.max(S.bulletSettings.Size.Z, 0.2)
		)
		Mesh.Parent = Bullet
	end
	local BF = Instance.new("BodyForce")
	BF.force = V3(0, Bullet:GetMass() * (196.2 - S.bulletSettings.Acceleration), 0)
	BF.Parent = Bullet
	Bullet.Parent = gunIgnore
	Bullet.CFrame = bulletCF + Direction * S.bulletSettings.Size.Z / 2
	Bullet.Velocity = Direction * S.bulletSettings.Velocity
	return Bullet
end
