How Do i fill gaps/hole on a part

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!
    wanted to fill gaps inside the part’s hole using script

this is the example
image

  1. What is the issue? Include screenshots / videos if possible!
    i think this is a very complex scripting and i really need help for my game

  2. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    yes but i didnt find any related topic

any help will be appreciated

1 Like

You would need to use a bunch of union and negation magic that I can’t make in a script without testing it myself. And I can’t test right now.

What do you need this for? Maybe there’s a workaround or something else you could use instead?

1 Like

i need this for my cutting game that cuts the object when the user is drawing something on the part using the cursor

Example:

The user will draw something random to cut the part leaving a hole that the user drew, like this:

The method that i used to achieve this is by converting the user’s drawing into a 3d part, and filling the gaps/hole with parts that will be used to subtract the block using SubtractAsync.

But the problem is i didnt know how to fill the gaps.

Sorry if i didnt explained it really well and i hope you understand it. Is there any solution or maybe an alternative ways?

1 Like

Eyeballing this right now but have you tried sizing each part of the side by * 2 on the Z axis? at the end, the result should be each part fills the middle

1 Like

Sorry i didnt really quite understand what you’re saying, could you maybe try to visualize it using drawings?

1 Like

I’m basing this representation off of your initial example, but essentially just make the parts fill towards the middle in the Z axis.

and in the end it would be something like this with all the parts filling the specific area

this would require some testing for it to be put into practice but the only con is the parts would overlap each other.

1 Like

Yeah theres a big chance that the parts would overlap. Is there any alternative solution regarding this topic? Any help would be appreciated.

1 Like

Well if parts do overlap you can change their Y size or position by a very small amount(like 0.001) to get rid of the z-fighting effect.

1 Like

Is there like an alternative way/methods to cut the block using the user’s drawing?