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

Is there a way to make a ray ignore everything EXCEPT for specific bricks?

Asked by 8 years ago

Basically what my question asked. Is there a way to have a ray ignore everything in the workspace except for specific bricks? Preferably a method that doesn't involve scanning the entire workspace to put all the bricks into a table and then remove those specific bricks. Thanks!

2 answers

Log in to vote
2
Answered by 8 years ago

The simple answer is No.

Without sticking everything that is not a parent of the bricks into a table, there's no way. That said, you can stick all of the bricks into a single Folder or Model and use the ignoreDescendentsInstance parameter of Workspace:FindPartOnRay()

0
Eh, alright. Thanks anyways! TurboFusion 1821 — 8y
Ad
Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
8 years ago

Adding on to eLunate, it may be easier to simply check what you hit. Instead of ignoring all but a few bricks, just make sure what you hit are those bricks.

if hit.Name == "SpecialBrick" then
0
Checking them assumes that the ray is not meant to ignore the parts, but instead the code is meant to ignore it. User#6546 35 — 8y
0
This makes sure that the part you hit is the 'special' part. It would be easier than ignoring all other parts, and would still work fine in most situations. Perci1 4988 — 8y

Answer this question