How do I get the percentage of a part that's touching/inside another part?

so i did a bit of digging cuz I gotta help a sister out and came across this reddit post in the unity subreddit that leads you to this and that
which reminded me that roblox has a similar CSG manipulation thingy thing
this is where we start cooking
looking for a way to find the intersection i dug and found this announcement which actually lets you have the overlap between the two points become its own part
which led me to this function inside the documentation which returns the intersection instance

so…

  1. if you can get the intersection instance
  2. get its size
  3. and somehow compare it to the size of the two parts to get the percentage…
  4. you got this down!

(although, if you need the result fast… this aint the solution for you… the function yields and generally doing cursed CSG stuff like this at runtime goes wrong very easily…)
[only use this method if you fr just want to account for multiple different shapes and rotations]

2 Likes