I am very excited to say I’ve finally gotten a 3D game with mobile touch controls uploaded onto my phone and playable as an app! This is an important step for my PPP project because I have felt since week 1 that there is no point adding any assets into a game scene unless I know that I’m actually going to be able to get it to work on my phone. It’s also a satisfying moment because it took a really long time and a lot of frustration was dispensed.
The first thing I did was to browse various tutorials on YouTube, which was complicated by the fact that there were several terms I didn’t really know to search for. I came across a video called “Mobile Joystick with NEW Input System and Cinemachine - Unity 2020 Tutorial” after many false starts, and this one seemed like it could help me because the first seconds showed the video creator- samyam- playing a 3D game on their phone, and also because many of the comments said things like:
Literally, the only tutorial I found about touch control joystick using the new Input system.
Thank you so much!
The video runs for 34 minutes but it really took me an entire day to get through it. samyam did so many things that I didn’t (and don’t) really understand including chopping up and editing bits of Unity’s code to suit your own needs, and using Cinemachine and the Input System. When I got to the end I thought I would be able to playtest the game by downloading the “Unity Remote 5” app to my phone, connecting the phone to my computer and then hitting play on Unity. When that didn’t work I again scrolled through the comments to find many people had had the same problem and that samyam attributed this to the fact that the new Input System would not work on Unity Remote. Bummer.
My only solution was to export the project out of Unity and onto my phone. But how do I do this? Xcode! This super cool sounding app for my computer required me to update my macOS (which took ages and required me to make several changes and backup many files). I still wasn’t totally sure if I needed to have an Apple Developer license in order to follow this path but I discovered that you could indeed upload games directly to your own phone without one. I found this four minute tutorial which made it all seem very straightforward and then…. it still didn’t work!
I uploaded *an* app to my phone but it was displaying an empty Unity 3D scene and not the flashy mobile touch game I had made with samyam. Crap! There must be something wrong in Xcode, a program I know NOTHING about. I found several error messages in the Xcode build report that pointed to bits of my code and said things like “This function declaration is not a prototype” which, as well as being super rude, I barely know what half the words in that sentence mean. I poured over many forums and Xcode videos, stopping short of watching a 40 minute Xcode intro tutorial, before I finally consulted my friends in Unity Club, a club I’m co-running. I got some great advice on Xcode settings and Unity Player settings that are crucial to making it run, and on what error messages in Xcode I could probably ignore.
And then…it worked! I now have an app on my phone which plays the 3D game that I made. The touch controls work and the graphics actually look really good, a big upgrade from what I was making last year.
Now finally I feel as though I can justify getting started on fleshing out the game world, hopefully using the Terrain Editor again. The samyam tutorial also got me interested in Cinemachine and the Input System, and so I am very excited to explore those further too.
By Harry Hughes
Email Harry Hughes
Published On: 25/03/2021