Raycasting issues - Finding part on ray

I’m currently having an issue when trying to get the part that intersects with the ray I’m casting.

local bullet = Ray.new(bulletExitPosition,calculatedDirection);
local bulletHitPart,bulletHitPosition = workspace:FindPartOnRay(bullet,parsedPlayerCharacter,true,false);

As you can see, It’s typed out correctly, however, when I print bulletHitPart it will always return nil, however when I print bulletHitPosition it returns a valid Vector3 position.

I’m not too sure what I’m doing wrong, any and all help is greatly appreciated!

Could be a misnomer with your Ray’s direction, because when FindPartOnRay doesn’t intersect with a part, it simply returns nil for the first argument and the position at which the ray ended for the second.