I’m going with the simplest solution I can think of for limiting how far away a player’s sphere can travel after they release it by closing their hands.

  1. Stop its position by removing all force applied to it once it’s fully outside the marching cubes grid.
  2. Start a timer for 3 seconds. If the hands remain closed for the full duration, reset the position of the sphere to the center of the hands. Otherwise, draw it back to the hands as normal once they’re opened.

I ended up adding an additional rule because the sphere didn’t receive a strong enough pull back to the hands after they got reopened:

  1. Add an impulse force toward the hands when unfreezing the sphere.

This did not work as expected.

Since I tell the hands to close whenever the metaball exceeds its bounds, I get some sort of race condition that interferes with trying to open the hands back up. I need to sketch this out better.

That’s all for today, folks.


Tags: physics unity metaballs debugging gamedev