I have discovered a strange crashing bug with GeometryService:SubtractAsync (and this probably affects UnionAsync as well)
I use SubtractAsync in my game for destruction, and when my script attempts to call SubtractAsync on a Union that is parented to something besides workspace, the game will crash. (weirdly enough, this does not happen in studio.)
I know this because I tested it manually. moving said Union out of the model and into workspace prevents the crash, however, moving it back into the model will cause the game to crash.
As I said before, this is only in-experience. This doesn’t seem to happen in studio, at least not for me.
In these two examples, I perform a SubtractAsync operation on a Union. (The black part thing you can see in the video, for context: That is the Union and it has a sphere-like shape).
In one video, where it doesn’t crash, the Union is parented directly to workspace.
In the other video, where the client closes, the Union is parented to a Model.
Crash Example:
Non-Crash Example:
I’ve provided the relevant code from my module if that helps at all:
! WARNING ! this may not compile as is as it’s a module from my game with local dependencies.
However, it I’ve included everything that’s relevant so you should be able to deduce what’s going on from what I provided.
I included a print statement just before the SubtractAsync as additional confirmation.
The code is located in the private content section.
Expected behavior
If everything was correctly, the client wouldn’t crash. I have noticed that the Union seems to be unaffected (not cut or anything) even when the game doesn’t crash, however, that might be more of a me thing, so I won’t consider that as part of the problem.
A private message is associated with this bug report