Mobile 2D Space Shooter
Learn how to build mobile controls for a 2D Space Shooter game
Learn what this course has to offer
Building for Mobile
Learn how to convert the 2D Space Shooter into a mobile friendly game
Shoot Asteroids on your Phone!
In this mobile course we’ll learn how to convert our popular 2D Space Shooter into a mobile friendly game. This is a beginner introduction to building mobile controls for your game. The 2D Space Shooter is a great game to start off with since it’s quite simple and great for performance due to it’s 2D nature. You’ll learn how to:
- Design UI controls in Photoshop
- Create platform specific methods
- Convert an existing game to mobile controls
- Script a stand alone joystick for all your mobile games
- Build and deploy your game for iOS and Android
If you’ve ever wanted to learn how to build mobile controls for your game, then this course is a great start to learning how to control movements with a virtual joystick and UI based buttons. Take your space adventures on the go, lets get started!
Lesson Questions and Answers
Ask a question and get an answer!Submit your Question
Hi, in your 4th video “BuildingMobileUI” After configuring the buttons you go in the Game manager, i don’t have it on my screen, how do i create it ? I can’t find it in previous course. I’m totally new to Unity, sorry if it’s a basic question !
Sorry for the late reply, didn’t get a notification on your question. The game manager should be a part of the scene, if it isn’t then you can drag it in from the project panel as it was created as a prefab previously. If you need further clarification let me know.
I am also getting a new error. NullReferenceException: Object reference not set to an instance of an object
GameManager.Start () (at Assets/MobileSpaceShooter/Scripts/GameManager.cs:54)
Hello Jonathan. I am taking a break on this course so that I can go through the Scripting Bootcamp course that you have available. I really want to learn this. Please be patient with me. (Smile)
No worries, take your time. To answer your original question whenever you get an error like that it’s because you’re trying to create/use something that you haven’t referenced in your script yet. If you double click the line in the console it’ll usually open up the script and go directly to the line it’s having issues with.
I am getting an error. “MissingComponentException: There is no ‘GUIText’ attached to the “ScoreUI” game object, but a script is trying to access it.
You probably need to add a GUIText to the game object “ScoreUI”. Or your script needs to check if the component is attached before using it.
GameManager.UpdateScore (Int32 scoreToAdd) (at Assets/MobileSpaceShooter/Scripts/GameManager.cs:155)
GameManager.Start () (at Assets/MobileSpaceShooter/Scripts/GameManager.cs:78)”
What am I doing wrong?
We’re using the UI text instead of GUI text. In the scripts I commented out the GUI text variables. Make sure those are commented out and that you’re instead using the UI text versions. If you look at your script from the inspector panel, those variables should say “none (Text)” when they are empty. If it says GUIText or something different then you’ll need to change that in script.
In the video you state that you have already done this. But the script that was included in the project files were not done. I can send a screenshot of the script that was included in the project source file. Scripting is not my forte. Not sure how to create new methods for lines 83 to 147. The update is not included in the script that I have.
The changes were made to the script in scene 03 and on. Before that it was still left in. I should’ve clarified this in the course. You wouldn’t need to make new methods. All you would need to do is find anything that says GetComponent() and remove it.
For example in the original UpdateScore method it had this line: scoreText.GetComponent().text = “Score ” + score; you’d then update it to say: scoreText.text = “Score ” + score;
The UI text would be written out in that way. You could also use the updated version of the script in the scene 03 project files as it is updated from that scene on.
Download any course files here.
Check out submission from others.Submit your Image
Oh snap! No one has submitted their course results yet.
Sharing your work is a great way to grow as an artist. Why don't you take the lead and share your results for this course?