Raycast selection?

I’m attempting to create a selection tool using Raycast to determine whether or not a Part is selected:

Mouse.Button1Down:Connect(function()
	local Target = API.Raycast(Camera.CFrame.p, Mouse.Hit.p)
	if Target ~= nil then
		print("Yes")
	else
		print("No")
	end
end)

--||--||--||--

API.Raycast = function(Origin, Direction)
	local raycastParams = RaycastParams.new()
	raycastParams.FilterDescendantsInstances = {TriTerrain}
	raycastParams.FilterType = Enum.RaycastFilterType.Whitelist
	
	local raycastResult = game:GetService("Workspace"):Raycast(Origin, Direction, raycastParams)
	if raycastResult then
		if raycastResult.Instance ~= nil then
			return raycastResult.Instance
		end
	end
end

The reason I’m doing this is so that the Mouse ignores any obstructions in the way and selects what is needed -
However, this doesn’t seem to work as the Mouse.Hit.p is stopping wherever the obstruction is.

How can I work around this or extend the direction of the Ray to bypass the obstruction and register the part?

API.Raycast(Camera.CFrame.p, Mouse.Hit.p)

Isn’t the second parameter supposed to be the direction? In that case, try

API.Raycast(Camera.CFrame.p, Mouse.Hit.p - Camera.CFrame.p)

or

API.Raycast(Camera.CFrame.p, Mouse.UnitRay.Direction * 5000)

TargetFilter only allows for one instance at a time; using Raycast, I can whitelist all the areas actually required and work from that.