Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Do A Ray Ignore Transparent Parts?

Asked by 7 years ago

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

Log in to vote
2
Answered by
UgOsMiLy 1074 Moderation Voter
7 years ago

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

01local ignore = {}
02 
03for i,v in pairs(workspace:GetDescendants())do
04    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
05        table.insert(ignore,v)
06    end
07end
08 
09-- Then you would do
10 
11workspace:FindPartOnRayWithIgnoreList(ray,ignore) -- provided you have defined "ray"
0
thanks my guy lawahh19 2 — 7y
Ad

Answer this question