Result was empty, possibly because everything got subtracted away

I’m making a game with slicing physics, but there’s a weird bug. It thinks that there is nothing, but that’s not true.

How it works

First, it gets two big negative blocks in a model, and pivots the model to the blade.
If I’m swing horizontally, it would look similar to this.


Using the original part, it then subtracts it twice, using the different negative blocks, so it looks something like this.

Since using subtract async basically clones the part, it doesn’t delete the original part, so I can do that myself.

Well, the whole rod is covered by the red cubes, so of cause there is nothing left…?

No, like I said, it basically clones the part, so it’s two separate parts.
If you haven’t read the “how it works” summary thing

I found another bug

Just try with Unanchored Parts to show what’s happening in real time without having to move the Unions out of the way to see what’s happening.
It looks like every time you slice you get another Union in your workspace so that’s a good sign.

Look at the original post, theres a video of the pole unanchored, and it falls down, but it’s kept upright by a prismatic constraint
heres another video that i recorded earlier

based on that video there, the area IS empty

well yeah for that video I get what you mean, but trust me, it happens all the time, even when there should obviously be something there

You may not be slecting every part for the union that you need to be.

what do you mean?

303030303

Sometimes it also deletes unnecessary parts too.

In your script, you may not be putting all of the parts into the union thingy

like, as in the subtract async? this is the code for the first slice

local slice1 = part1:SubtractAsync({negatives.NegativeLeft},Enum.CollisionFidelity.PreciseConvexDecomposition,Enum.RenderFidelity.Automatic)

Is it possible the part1 is no longer the thing that needs to be subtracted from (you mentioned that it clones something earlier, didn’t you?)

No. What I meant was, when ever you use subtract or union async, it creates the union without modifying the original parts at all, and it sets the union’s parent to nil, so you have do manually set the parent of the union, and delete the original parts.

Even with adding a solid delay from which it can and can’t cut, it still does it. I though it may have been slicing the union’s aswell, but I guess not.

edit: I fell like real-time subtract async is just whack, but then of course you got the all-working other slicing demo someone made (its complicated so idk how to make it work with my katana)

yo i think i may have found something, for some reason if I immediately destroy slice1, then it rarely bugs out

1 Like