Progress in different ways. The merging of two differently sized spheres still doesn’t work, even though I rewrote my merge algorithm with InverseLerp. This has been tricky to debug since the attractor and attractee are constantly switching every iteration of the for loop. Imagine when I add additional spheres! My code is getting harder and harder to read. It was time for me to re-organize, so what I did was create a constructor for each sphere containing its Rigidbody, original scale, and an attraction radius that I intend to make proportional to the current scale. AddGravityForce() now takes in an attractor and attractee constructor as parameters. I saved the pre-constructor script for archiving purposes.
Since I’d already solved the merging, I decided to add closure to the unity thread I created. I posted some of my code as a solution along with this clip of the spheres merging.
Not gonna lie, I was a bit hesitant to post my working algorithm in the thread, due to fear of getting my code stolen and used without being given credit. That was until I remembered that a great deal of what I’ve learned has come from the openly shared knowledge of others. Amen!