My husband finally returned to Saskatchewan on Monday after a glorious two weeks of covid-induced togetherness. We played video games (well, I mainly watched him get faux angry playing Elden Ring), eventually made it outside to climb some mountains and enjoy the outdoors, and ate some very delicious pizza (two pizzas, one savoury and one sweet, from different pizza places, in one night) – it was quite the no-cook Friday!

Cocktails and lunch at the Restaurant at the Top of the World – Sky Bistro is a lovely little restaurant at the top of Sulphur Mountain in Banff. There is a Gondola to the 2500-m peak, but we enjoyed the 5.5-km hike to the top instead.

Alas, I failed again in the creativity realm, although I have been making some good contacts in the XR field and attended a couple of really good online sessions with the VR/AR Association and a new group I found, XR Women. I also got invited to present at a conference on my XR journey for the first time, so pretty pumped about that. But, I didn’t achieve anything noteworthy enough to replace the second instalment of my Elevator “making of”, so here goes…

Part 3: Setting the Destination Depths

No elevator is complete without some buttons and fixed destinations. My next steps were to make some animated buttons and then find a way for each one to set a specific destination when pressed. Thankfully, this stage coincided nicely with my Circuit Stream class on animated buttons, so I was able to hijack the steps for setting up (i.e. modelling them and adding the required collider components) and animating the buttons and the code for triggering the animation and the SetDepth method.

Script that controls button animation and the triggering of the OnButtonPressed() Event
Script that assigns the SetDepth delegate method to the OnButtonPressed event and sets the destination depth (specified in the Unity Inspector for each instance of the script – attached to each of the buttons)

One issue I do have to sort out is the size of my colliders – it is still quite easy to push two buttons at once, and I have to coach (or even physically manipulate) everyone who plays to point their hands in a strange way so they just hit the button of interest. Again, something that will be easy to fix, I just haven’t got around to it (and maybe I just like moving people’s limbs like they’re marionnettes).

Animated buttons on the elevator console, complete with slightly-too-big box collider

Part 4: Disaster Strikes!

Due to his job in the Canadian Air Force, my husband lives most of the time in Moose Jaw, Saskatchewan, about an 8-hour drive east of Canmore. Since I have been working remotely for the duration of the pandemic, this has afforded me the opportunity to periodically go there to work for a couple of weeks and spend some time with him. I decided that it would be nice to make such a trip for my late-June birthday last year. By this time, I was nearing the end of my 10-week XR developer course and making good progress with the fundamental mechanic of the game. However, I had noticed a worrying bug – as the elevator moved, gaps between shaft segments were developing, increasing in size the longer the elevator was moving. Being able to see sunlight through the gaps really got in the way of the “deep inside the earth” effect I was going for, so I was pretty keen to fix it.

What a beautiful sunset – not the view you want when you’re supposed to be deep deep underground

Now, many years ago (the week before I met my husband, back in 2008, actually), I learned the perils of not backing up when my hard-drive clapped out near the end writing my PhD thesis. While I didn’t lose everything (I wasn’t THAT stupid), I lost enough to make me somewhat obsessive about backing up. So, throughout the development of Elevator, I was regularly and dutifully backing up to the Cloud (using Unity’s Github-like Collaborate). Or so I thought. It turns out I was not using it properly, and when I tried to revert to an earlier version of my project to undo something that I had tried, but had not worked. I LOST EVERYTHING. ON THE DAY BEFORE MY BIRTHDAY. I was devastated. Did I mention it was the day before my birthday?

Thankfully I had an early version resident on my old computer (I had discovered the need to upgrade my machine once I wanted to start hooking things up to my headset), and I had reasonable versions of the elevator movement script and some other key scripts saved there. So, I spent the weekend rebuilding everything (fortunately my husband is quite content to be left playing video games while I completely ignore him to faff around with Unity). It was a little bit off-putting that it only took me two days to build back better!

Needless to say I spent some time learning how to use github.

Part 5: Gaps in Middle Earth

Unfortunately, despite building back better, I had still not managed to fix the issue with the separating shaft sections. I drew diagram after diagram, checked my sums twice, thrice, and more, but still I could not work out why despite diving deep into the dark, solid earth, you could see “outside” with increasing regularity… As is usually the case with these nagging little problems, it turned out to be annoyingly simple. I finally realised that when I was flipping the segments back to the top/bottom of the stack, I was moving each segment TO a particular POINT, when I should have been moving it BY a particular DISTANCE. The problem with moving it to a fixed point is that I wasn’t moving it FROM a fixed point – instead, a segment would flip on the first frame where it was at a height above or below a fixed point, which, because of the irregular frame duration, was not always at exactly the same point. And, the more times a segment flipped, the bigger the issue became. On the bright side, in typical coding fashion, although it took weeks to work out the issue, it only took a few minutes to fix it.

Categories: General