New raycast keeps returning nil

        local origBack = l.Position
		local dirBack = -l.LookVector*3
		local hitBack = workspace:Raycast(origBack, dirBack, params)
		print(hitBack and hitBack.Position)
		local hBack, pBack = workspace:FindPartOnRayWithIgnoreList(Ray.new(origBack, dirBack), _G.params)
		print(pBack)

idk why using the new raycast method it returns nil whereas the old raycast returns the position
sorry i’m new to raycasting :sob:

1 Like

Could you show what your params look like?

params.FilterType = Enum.RaycastFilterType.Exclude
_G.params = {
	char,
	cam,
	workspace.Map.Glass,
}
params.FilterDescendantsInstances = _G.params
1 Like

This looks right, so could you show me the whole code?

Why don’t you use the same params?

they are the same params. it’s just the old raycast only take in tables in contrast to the new one where you have to define RaycastParams.new()

for privacy reasons, no. for context, this ray shoots out from the characters back, but the issue here is why the new raycast returns nil whereas the old one returns a value, even if it’s the same ray?