Raycast ignoring random parts?

I have this confusing problem where my raycast will ignore a part in a certain spot and stop raycasting there. I have tried removing my raycast params, still happened. (It doesnt work on flat parts above a certain y-level.)

Code:

local raycastParams = RaycastParams.new()
	raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
	raycastParams.FilterDescendantsInstances = getTable()
	
	local origin = humRP.Position
	local ray = workspace:Raycast(origin,mouse.Hit.Position-origin,raycastParams)
	if ray then
		if (ray.Position - humRP.Position).Magnitude <= MAX then
			snapHolder(ray.Position,ray.Instance.Orientation)
		else
			if placeHolder then
				placeHolder:Destroy()
				placeHolder = nil
			end
			
		end
	end

If you want your raycast to stop only when it hits parts in the table you get using getTable() then you need to use the Whitelist filter type.

No, I mean’t that the ray cast stops at a random part, the part is not black listed and even with the raycast going 1500 studs it stops at the part.

Even though this is a duplicate of another part that this doesnt happen to.

The direction parameter is the issue:

aha, it’s funny because I realized I forgot to multiply the direction just before I saw this.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.