At Leap Motion, we’re making VR/AR development easier with Widgets: fundamental UI building blocks for Unity. In part 3 of our Planetarium series, Barrett talks about the strange physics bugs we encountered with Time Dial.

One of our new VR Widgets, the Time Dial, surprised (and indeed amused!) us at several special moments during our intense production push. The Time Dial Widget is our hand-enabled VR interpretation of a typical touch interface’s Date Picker. We built it with a combination of Wilbur Yu’s Widget interaction base, Daniel’s data-binding framework (more on those two later), and a graphic front-end that I coded and built – again using Unity’s new 3D GUI.

Immediately after adding the shiny new Time Dials to the Arm HUD’s flyout panel, the Arm HUD itself went essentially haywire. As we would change the Month, Day or Hour, buttons on the Arm HUD would begin to trigger by themselves, making panels fly open or disappear. Yikes! We soon realized that while our Widget physics for springy buttons being pushed by virtual hands worked reliably in typical situations, we were spinning the earth at spectacular, epic velocities. This made Unity’s physics engine cry, triggering the Widget buttons without the need of virtual hands.

Between epic velocities and accidental gyroscopes, we’re pretty sure we broke a few digital laws of physics.

Additionally, we discovered that the Time Dials would continue spinning indefinitely after we let them go… sometimes. This was one of those intermittent, tricky-to-solve bugs we love so much. But through dogged observation, Gabriel discovered this only happened if we were pointed east or west. Weirder. In the end, he deduced that while we were clamping the Time Dial’s rotation to its X-axis, if the Earth and Time Dial were in just the right alignment, the Earth’s momentum would transfer to the Time Dial. We had accidentally created a gyroscope!

Interestingly, these bugs emerged after quite prodigious amounts of rigorous user testing. Literally dozens of user tests have been run at our office, all carefully recorded and scrutinized. But running our Widgets through the crucible of Planetarium’s forces, ranging from the fingertip scale to the astronomical, gives us valuable insight on how to make the Widgets even more robust for developers. In the future, we’ll be moving away from using Unity’s physics engine, and coding our own, simpler interactions.

Next: Travelling Around the Globe (and Under the Sky) in Planetarium

An interaction engineer at Leap Motion, Barrett has been working at the intersection of game design, information visualization and animation craft for 20 years as a producer, game designer, and animator.