Accurately detecting bounds of unionized part's holes

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    My goal is to use a script and color all the grass blades that touch the Unioned Part black

  2. What is the issue? Include screenshots / videos if possible!
    The script is working to a degree but it is not accurate enough

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have researched the collision inaccuracies of union operation and came up empty-handed with a different method to use for detection

I am making a plugin with the goal to create grass blades on a Union part. I then want it to test every blade to see if it actually touches the Union. To do this I am using a for loop and the lua GetPartsInPart() function to use the physics engine on every part and detect if it is actually touching the Union.

I am looking for a method that will let me accurately detect if a grass blade is inside of the Union. Any help is appreciated! Thanks!

Will the union itself be the same for every time you run this? If so, you may be able to solve this issue strictly through math.

I intend to use more complex, but still “2D” Unions. Aka More holes, different size holes, different shape holes, etc. TLDR, no it will be different every time during the plugin’s intended application.

Hey, after a couple of days away and some research about the GetPartsInPart() function and Roblox collision I have solved my issue. I eventually found this post:

It detailed a “new” feature that changed how Roblox would calculate collisions on parts by changing the collision fidelity. In my studio here is what I changed on the mesh/union parts. I changed the property from “Default” to “PreciseConvexDecomposition”.
Screenshot_8

Here are the parts I used:

Here are the processed results:

And a video of the plugin working because why not (Sped up 16x):

1 Like