RayCasting Filter out Certain Objects

Hi Devs,

I have table made houses certain parts that I don’t want to be hit by Raycasts.

In my current raycasting code, I already filter out characters.

local rayParams = RaycastParams.new()
rayParams.FilterType = Enum.RaycastFilterType.Blacklist
rayParams.FilterDescendantsInstances = { character }

I have tried adding the table into the FilterDescendantsInstances next to character, but I get an error when i do this.
image

Would anyone be able to give me some insight as to why I am having this issue and get me moving in the right direction?

So character is a table? Then you can just remove the { }.

2 Likes

Ahh I don’t know why I didn’t think about that.

Thanks for the easy fix