Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How Do A Ray Ignore Transparent Parts?

So Im New To Using Rays Here Is A Photo That Explains My Probelm With Tittle https://imgur.com/a/Hu9Ev If You Dont Get It Is There A Better Way For Ray To Ignore Transparent Parts Instead Of Naming Everyone

1 answer

✓ Accepted answer

You would just go through the descendants and add the transparent parts to the ignore list.

local ignore = {}

for i,v in pairs(workspace:GetDescendants())do
	if v and v:IsA("BasePart") and v.Transparency >= 1 then -- 1 means fully transparent, so set this to the minimum transparency you want the ray to ignore
		table.insert(ignore,v)
	end
end

-- Then you would do

workspace:FindPartOnRayWithIgnoreList(ray,ignore) -- provided you have defined "ray"

1 comment

0

thanks my guy

This discussion is preserved as it was. New answers, comments, and votes are closed.