I need help debugging raycasts!

I am trying to create a “projectile” path prediction function. The projectile is the player’s character, and the function fires on jump. ( The character is entirely custom and uses bodymovers .

I am successfully creating the projectile path as seen below.

The higher end of the arc is time zero.

I am trying to cast a ray wherever you see a red segment, like so:
21 AM

You can see my current results below.

As you can see, most of the time the hit point is either slightly offset, or just doesn’t exist.

Here is my ray construction code. I am using the same code used to position the cyan spheres and the green rods. The cyan spheres represent ray starting points, and the green rods represent ray end points.

local StartPosition = (CFrame.new(Root.Position, Root.Position + XVelocity) * 
	CFrame.Angles(0,math.rad(90),0)* CFrame.new(PointsArray[i])* CFrame.new(0,-.05,0))

local EndPosition     = (CFrame.new(Root.Position, Root.Position + XVelocity)* 
	CFrame.Angles(0,math.rad(90),0)* CFrame.new(PointsArray[i+1])* CFrame.new(0,-.05,0))

	
local Raycast = Ray.new(StartPosition.Position, (EndPosition.Position).unit * Length)

local Part, Hit = workspace:FindPartOnRay(Raycast, Character)

I just want to know if there is anything obvious in this code. I know it isn’t very much information, but there is a lot to look at, and this seems to be the only part causing me trouble.