I'm trying to create a trail that follows the player. It looks great if the player is walking in a perfectly straight line, but if they happen to take a sharp turn, it turns god-awful jagged. How would I go about fixing this?

local char = script.Parent
local hum = char:WaitForChild("Humanoid")

local size = 2
local waittime = 0.1

while true do
	if hum.MoveDirection ~= Vector3.new(0,0,0) then
		local trail = Instance.new("Part",game.Workspace)
		trail.TopSurface = "Smooth"
		trail.BottomSurface = "Smooth"
		trail.CanCollide = false
		trail.BrickColor=BrickColor.new("Bright red")
		trail.Anchored = true
		trail.FormFactor="Custom"
		trail.Size = Vector3.new(.4,.4,size)
		trail.CFrame = char.Torso.CFrame
		
		game.Debris:AddItem(trail, 1)
	end
	wait(waittime)
end

The script is in StarterCharacterScripts. Thanks!