Raycast failure to detect terrain

Is it a known issue that raycasting sometimes fails to detect a hit on terrain?
It is a small fraction of the time. I didn’t see anything specifically about this in the forum.

I’ve never experienced raycast ignoring terrain, can you provide your code?

that’s not easy to do. i don’t have a usecase that consistently produces this result. the code that does show it only does so occasionally (can’t say how often). the code is raycasting around a humanoid to determine a path, blockades, materials to avoid, etc.

one place it occurs - sometimes - is this code which is simply used to raycast down to determine the height above the material the humanoid is standing on. I draw beams (in the caller) to show the ray and the endpoint will be shown below the terrain.


function raycastDwn( position, blackList, maxDistance )
	local raycastParams                      = RaycastParams.new()
	maxDistance = maxDistance or t.MAX_RAYCAST_DISTANCE
	raycastParams.FilterDescendantsInstances = blackList
	raycastParams.FilterType                 = Enum.RaycastFilterType.Blacklist
	raycastParams.IgnoreWater                = false
	--raycastParams.RespectCanCollide          = true
	return game.workspace:Raycast( position, maxDistance*Vector3.new( 0, -1, 0 ), raycastParams )
end