Problem with the bullet part

I have a problem where this code works

Bullet.Size = Vector3.new(0.2,0.2,(Character.Head.Position - mouse.Hit.p).magnitude)
	Bullet.CFrame = CFrame.new(Character.Head.Position, mouse.Hit.p) * CFrame.new(0,0,-(Character.Head.Position - mouse.Hit.p).magnitude/2)

when the part is a normal part

but when its a cylinder it looks like this

Can someone help me?.

The Y axis is the one you want to point towards the target and stretch, you’re using the Z axis currently.

After you point the CFrame at the target, but before you offset it by half the distance, try rotating it 90 degrees on the X axis.