Working with GameObjects in Unity 👾

Given I’m currently learning to develop in Unity I thought I’d share a few tips I pick up along the way to becoming proficient with it.

When creating a scene in Unity you’ll work with loads of different GameObjects. Your virtual world is built out of them (Floors, walls, trees everything) and you’ll be manipulating them all the time.

One thing you’ll notice is the more GameObjects you have the more complex it becomes placing things correctly. Trying to line everything up, preventing different objects overlapping, and just generally making things look as they should, can consume a lot of time.

Thankfully there are a few things you can do to make life a whole lot simpler. First is learning to navigate around the environment, second duplicating objects, third vertex snapping.

Navigating the environment

The odds are good if you’re doing VR development in Unity you’ve played at least some 3D person shooter on a PC or Console. If so, you’re in luck because navigating in a 3D unity scene can be exactly like this with a few extras. Click and hold the right mouse button and you’ll be able to look around the environment with your mouse and use the WASD keys to move forward (W), backward (S), strafe left (A), and right (D). A little extra something for moving quickly is selecting a GameObject and pressing the F key to jump to it for manipulation.

Duplicating objects

When creating an environment it’s essential to duplicate GameObjects or groups of objects. To do this is very easy, just select the GameObject and do what you’d do to duplicate and just like text in a text editor, copy and paste. Easy as that you’ll have a duplicate item to move around and position in the scene.

Vertex snapping

For the first few months I was learning I didn’t know about this one and boy does it save some time and frustration. Let’s say you’ve got a section of wall and you’ve duplicated it to make the wall bigger. You move your newly duplicated wall GameObject to line it up with the original and you slide it along just a little, you eyeball it and there’s a small gap. You move it back a little and now it overlaps. This sort of thing can go on and on. Vertex snapping will save you from hours of repetition by allowing you to snap two objects together cleanly.

To do this, select the move tool then select the GameObject you want to move. Now hold down the V key, move your cursor to a vertex, then click and drag it to the vertex of the GameObject you want to snap to. Now release the mouse button and boom, just like that, you’ll have a perfectly placed GameObject in line with the first.

Now to be completely honest it can be difficult to get your head around vertex snapping from reading a text description of it. Thankfully a number of people have made excellent YouTube videos showing just how it’s done. Here’s one I found useful:

For more information on vertex snapping and a whole lot more, see the Positioning GameObjects section of the Unity manual.

AR/MR/VR/XR WTF? 🤔

One of the problems with discussion of emerging technologies is terminology, or more importantly the lack of clearly defined terminology. At the moment this space has a big issue with overlapping, confusing terms that consumers will likely never fully understand. It doesn’t help that the industry itself isn’t exactly using the terms consistently either.

The terms by definition

According to wikipedia the main three terms are defined as:

  • Augmented reality (AR) – a live direct or indirect view of a physical, real-world environment whose elements are augmented by computer-generated sensory input such as sound, video, graphics or GPS data.
  • Mixed reality (MR) – sometimes referred to as hybrid reality, is the merging of real and virtual worlds to produce new environments and visualisations where physical and digital objects co-exist and interact in real time.
  • Virtual reality (VR) – a computer technology that uses Virtual reality headsets, sometimes in combination with physical spaces or multi-projected environments, to generate realistic images, sounds and other sensations that simulate a user’s physical presence in a virtual or imaginary environment.

My interpretation of this is that there’s a spectrum here. So to explain it simply:

  • AR puts stuff on top of the real world, like a heads up display
  • MR puts stuff in the real world, like a digital character dancing on a real world stage
  • VR is replacing the real world, as in everything you see and hear is replaced by a computer generated environment

Unfortunately the industry is choosing to miss use these terms all over the place, which is super confusing.

The terms according to the big players

The use of these terms amongst the big players is mixed, but there does seem to be some consistency coming together. Typically MR isn’t really sticking, instead AR and MR and just being glued together into AR. Apple have ARkit, Facebook have AR studio, Google tango devices refer to AR. It makes sense really as from a consumer perspective the finer detail of the difference between the two seems kind of a pointless distinction. VR is also widely agreed to be the replace everything arrangement we know and love. Of course there’s always exceptions and shocking exactly no one Microsoft has decided to put all its chips down on MR. that’s right AR, MR, and VR all as one term.

What I’m calling this stuff

I’m not a particularly big fan of Microsoft’s naming conventions over the years, but I have to give it to them, I think a single catch all term is better in this case. Personally I prefer XR as it sounds cooler (it has an x after all) and x is always a good placeholder for a range of things.

Another thing a “catch all” has going for it, as I said earlier, I’m not sure users need the detail of two or three different terms. Something like XR says “cool tech that puts stuff in front of your eyes”, and then it’s just a question of how much stuff. It just seems more straight forward, I know it sure would make it easier to write about.

Just to keep things simple here I’m going to refer to anything on the spectrum between AR/MR/VR as XR. It’s just easier to write and read than all three terms individually. If the industry itself settles on a different term I’ll switch but until then as far as this sites concerned XR = AR/MR/VR.

More than games 🎮

When thinking of VR/AR/MR it’s easy for your mind to leap to games. Games are the obvious low hanging fruit of the industry, especially given all this stuff tends to be built in game engines like Unity and Unreal. But there’s far more potential to VR etc than just games.

There’s an increasing number of non-game apps surfacing. Many of these are a result of Apple’s ARkit being available in beta to developers. The one that jumped out at me recently was an augmented reality tape measure. It’s the sort of demo that just makes you smile. It’s so clever and obvious. In 12 months this sort of thing will be commonplace, the norm even.

Another example is Speech Center VR. This interesting looking app helps people face fears of public speaking or social anxiety. The developer, Cerevrum, have a number of VR apps that relate to some form of personal development using VR. VR is fantastic at taking you to places and putting you in situations you normally can’t. Cerevrum is making the most of that with their work.

The Body VR is another company crafting interesting educational experiences. They currently have three apps focused on various parts of the human body and target hospitals and medical training providers. It’s easy to see how experiencing the human body in this way would make it easier to recall the finer details.

This industry is still in its infancy, but already there’s just an explosion of fantastic content being produced. Content that has the potential to change every aspect of day to day life. Exciting times.

Mixed reality capture or: how to share your VR work 🎥

You’ve likely all see the videos showing VR users actually immersed in a VR world, like the demo at WWDC. The question is, how can you do the same with your work?

Well aside from requiring a few extra bits of gear to your normal VR setup, it actually seems fairly straight forward. Ars technica have put together a nice tutorial covering off what you’ll need and how it’s done.

A handy skill to add to your repertoire.

VR design – Google Street View for iOS 🗺

Part of my Udcaity VR course involves doing a quick/light review of a Google Cardboard app. So I figured I might as well post that here too.

VR App review – Google Street View – iOS

To call Google Street View for iOS a VR app feels like a bit of a stretch. Upon opening the app it’s immediately obvious the app isn’t designed from the ground up for a VR experience. Instead, it’s optimised for its primary audience of phone users.

On the home screen, there’s nothing to indicate there’s a VR interface option at all. The search bar at the top of the page obviously requires keyboard input, the main map, and even the tiles at the bottom of the screen, all require touch and there’s no way of switching into a VR mode from this view.

Google Street View UI
A mobile first UI

Those tiles I mentioned, that’s the easiest way to get to the VR side of things. Scrolling down the page show a seemingly endless list of Google Street View locations that can be viewed using a cardboard setup.

Selecting a tile presents a street view style UI (still not in VR mode yet). This allows the user to tap the screen and move around the environment. You’d be forgiven for missing the small icon in the top right of the interface for switching to cardboard mode. It’s the one that looks like a little cardboard headset.

IMG_4296
Not exactly obvious how to get to VR mode

If you were lucky enough to make it this far, you’ll be presented with a standard Google UI telling you to turn your device on its side and put it into your viewer.

Google VR viewer UI
Standard Google viewer info screen

Once in Cardboard mode, you’ll experience a familiar interface to many other Cardboard VR apps. One difference here is they’ve mashed VR together with a desktop browser style Street View experience. Obviously to look around you just… well… look around 😉 but navigation is done via a point and clicks teleport interface. This uses the “on ground” style direction button similar to Street View’s desktop UI. It works well and it’s fairly intuitive given the navigation follows the users’ gaze. Basically where ever you look, if you can go there, the arrow will point the way. I prefer a more obvious waypoint style interface as it makes it clearer where you can go, but that’s just a personal preference.

Google street view VR mode
Explore Machu Picchu in VR

As I said at the beginning it’s obvious this isn’t VR centric app, but then again it’s clear that isn’t the intent either. Given the nature of Cardboard being a mobile-based app, there’s an awful lot of sense in adding VR as a feature, rather than the primary UI.

Although mobile users are the primary audience, Google still does a great UI job for VR users and that’s to be commended. Really we shouldn’t expect less from an industry heavyweight like Google.

Of course, there’s always room for improvement, and this app is no exception. Street View being what it is doesn’t include any sound, it is just static 360 images after all. That being said it would be great to increase the emersion of the VR mode by including ambient environmental audio. It’s always amazing how good 3D sound can really put you in a place.

Conclusion

Ultimately Google Street VR did a good job of adding a VR mode feature to the mobile app. More could be done to improve the experience, but frankly, this is an impressive example of 3D content captured for one interface and repurposing it for another. It’s not exactly a virtual world tour vacation, but it might just encourage you to take one.

Augmented reality 📲

Ever since Pokemon Go, AR seems to have worked its way into the “parlance of our time“. Truth be told we’ve actually had loads of examples of AR apps for years now, just not combined with a cultural phenomenon like Pokemon.

I think it’s fair to say it’s highly likely there’s about to be a bit of an explosion in AR apps, at least on iOS. With the release of ARkit to developers and very impressive demos from both Weta and Apple on what can be done, it’s not difficult to imagine a new wave of apps in the works from third party developers.

In fact just oneish week out from ARkit’s beta release, developers are already starting to show some impressive progress playing with the tech. Take a look:

 

 

 

 

I ❤️ VR

I’ve been studying VR development for a few months now. As I advance in the course I’m having to choose a specialisation. I’m more interested in high immersion VR, like the stuff seen in the below video. Unfortunately, the cost of a VR setup is around $5k, which is quite prohibitive.
One of the challenges of online study over a more traditional on-campus model is having access to gear. Lucky for me I’ve managed to get some loaner hardware from my local public library. I couldn’t be more grateful as I couldn’t do this without their support. More on this later.