I managed to decouple the scale of the metaballs from their container and make their scale value accurate to world space. In the photo below, the sphere on the left is a metaball with a uniform local scale set to 1. The sphere on the right is a default sphere mesh set to a uniform local scale of 1. Aside from the mesh resolution, they’re twins.

Unfortunately, I’m getting memory leaks again. I’m no longer blaming memory leaks for poor performance, however, so fixing them is not high priority. They still specifically occur when switching from edit to play mode. For now, I should be able to make them disappear by disabling execution in Edit Mode.

Changes to the scale of a metaball now reflect accurately during play mode. There was a boolean function, CheckForBallsPos(), checking for changes in position every frame; I added a check for scale changes and that did the trick. Now, play mode fully mirrors edit mode functionality-wise.


Tags: metaballs unity gamedev vfx debugging scripting