Need a little help with bullet trail

I’m making a bullet trail for my gun.

So the trail itself is a part with a beam and 2 attachments inside of it
image

I thought the code would be as simple as just setting the position of the start attachment to the barrel and setting the position of the end attachment to the mouse position, and it kinda worked but with issues.

function Bullet:Fire()
	self._bulletTrail.EndAttach.Position = self._mousePos
	self._bulletTrail.Position = self._gun.Barrel.Position
	self._bulletTrail.Parent = self._gun
end

it works fine when I shoot at the sky but the problem is that the trail doesn’t attach itself to the ground when I shoot.

Here’s a video showing what I’m talking about:

Any help would be appreciated.