KevinGisi.com Whatever is here is here

Lessons from Unity

I’ve been exploring Unity a fair bit over the last month, as game development is a skill I’d like to have. My son has also been really interest in the solar system and different orbits.

If you’ll permit a tagent - we got into a discussion about how everything in the solar system orbits the barycenter, rather than the sun. And my son seemed to understand, in part thanks to these NASA visualizations: https://spaceplace.nasa.gov/barycenter/en/ And that of course got me on a tangent of thinking about why we lie to kids (I’m not being provocative, the Wikipedia entry is literally lie-to-children). I mean, we don’t teach them that things revolve around the earth – frankly, I think it’s cooler to understand that things orbit around a common center of mass, rather than the sun because “I said so”, but what do I know…

Back to the main topic. I was going through a Udemy course on mobile games in Unity (not an affiliate link), and built out a barebones Angry Birds clone. Naturally, once I’d gotten it loaded on my phone, my four-year-old was one of the first beta testers.

The ball itself operates on a pivot joint, so the intended use case is for you to draw back the ball – slingshot-style – and let it fly toward the structure. Unity physics takes care of the rest. And my four-year-old was immediately excited and laughing, but it did not remotely occur to him to draw back on the ball. Instead, he excitedly dragged his finger across the structure. And because the game is fairly simple without too many restrictions, the ball obligingly followed along with him, allowing him to knock out the tower with ease.

It was interesting to me because the slingshot mechanic was intuitive for me and my wife, but nothing in the UI directly communicates that. Effectively, my son taught me a good lesson about affordances.

I’d love to move on to my original goal of building a barycenter-based orbital simulator for my son to play with, but I’m kinda interested in evolving this mini-game now, based on my son’s excitement. And rather than fix the UX “bug”, I think I’d prefer the game to operate the way that my son expects: if he flings an object, it should preserve it momentum. My hope is that should’t be too difficult – just a matter of tracking Δposition across two frames, and applying an appropriate force before triggering Unity’s normal physics system. So maybe my son taught me two lessons: when folks find a bug - maybe the original behavior was ill-conceived in the first place!