Why is FindPartOnRayWithWhitelist dilapidated?

The Creator Hub says that FindPartOnRayWithWhitelist is dilapidated, i.e., should not be used for new work. But why? It is simpler to just put a white list in one line than to create a RaycastParams and set the properties manually somewhere else.

Is it going to be slower or something?

1 Like

I think its just the fact that the old raycasting needed to be overhall since you had to create an object just to make a universal raycast. And since then ray objects have been deprecated which means there isnt really a way to pass the ray so they’ve introduced all-in-one object with which you can customize how the raycast to act called RaycastParams. I think its way cleaner this way than the old way it used to be, way less methods to keep track of

1 Like

I don’t think it’s simpler, when I’m doing a lot of similar ray casts I just create a universal RaycastParams:

local universalParams = RaycastParams.new()
universalParams.FilterType = Enum.RaycastFilterType.Include
universalParams.FilterDescendantsInstances = {exampleInstance}
universalParams.IgnoreWater = true
-- other properties if needed

then if you need to make any raycast with these parameters just refer to the universalParams variable, or whatever you want to name it. I wasn’t programming back when rays were not made with workspace:Raycast() but I don’t have any issues with performance or huge codes.